Compare commits

...

1 Commits
master ... loop

Author SHA1 Message Date
Etzelia d95f937f7a
Loop
Signed-off-by: Etzelia <etzelia@hotmail.com>
2020-03-03 22:24:28 -06:00
1 changed files with 11 additions and 7 deletions

View File

@ -108,13 +108,17 @@ class Discord(commands.Bot):
def run_bot(self): def run_bot(self):
global discord_loop global discord_loop
try: loop = True
discord_loop.run_until_complete(self.start(self.token)) while loop:
except KeyboardInterrupt: try:
logger.info("Bot received keyboard interrupt") discord_loop.run_until_complete(self.start(self.token))
except Exception as e: except KeyboardInterrupt:
print(e) logger.info("Bot received keyboard interrupt")
logger.info('Bot encountered the following unhandled exception %s', e) loop = False
except Exception as e:
print(e)
logger.info('Bot encountered the following unhandled exception %s', e)
loop = False
def start(): def start():