from bowser.Bot import Bot


def main():
    bot = Bot()
    try:
        token = open('token.txt').read().replace('\n', '')
        bot.run(token)
    except Exception as ex:
        bot.loop.run_until_complete(bot.close())
        raise ex


def init():
    if __name__ == '__main__':
        main()


init()

from bowser.Bot import Bot


def main():
    bot = Bot()
    try:
        token = open('token.txt').read().replace('\n', '')
        bot.run(token)
    except Exception as ex:
        raise ex
    finally:
        bot.loop.run_until_complete(bot.close())


def init():
    if __name__ == '__main__':
        main()


init()

Remove one of the unclosed client session warnings
test: Remove one of the unclosed client session warnings

  from bowser.Bot import Bot
  
  
  def main():
      bot = Bot()
      try:
          token = open('token.txt').read().replace('\n', '')
          bot.run(token)
      except Exception as ex:
+         raise ex
+     finally:
          bot.loop.run_until_complete(bot.close())
-         raise ex
  
  
  def init():
      if __name__ == '__main__':
          main()
  
  
  init()
  
Remove one of the unclosed client session warnings
## Code Before:
from bowser.Bot import Bot


def main():
    bot = Bot()
    try:
        token = open('token.txt').read().replace('\n', '')
        bot.run(token)
    except Exception as ex:
        bot.loop.run_until_complete(bot.close())
        raise ex


def init():
    if __name__ == '__main__':
        main()


init()

## Instruction:
Remove one of the unclosed client session warnings
## Code After:
from bowser.Bot import Bot


def main():
    bot = Bot()
    try:
        token = open('token.txt').read().replace('\n', '')
        bot.run(token)
    except Exception as ex:
        raise ex
    finally:
        bot.loop.run_until_complete(bot.close())


def init():
    if __name__ == '__main__':
        main()


init()
