Signed-off-by: Etzelia <etzelia@hotmail.com>
loop
Etzelia 2020-03-03 22:24:28 -06:00
parent 4c9b01e42a
commit d95f937f7a
No known key found for this signature in database
GPG Key ID: 708511AE7ABC5314
1 changed files with 11 additions and 7 deletions

View File

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