Loop MCM bot (#47)
Loop Signed-off-by: Etzelia <etzelia@hotmail.com> Co-authored-by: Etzelia <etzelia@hotmail.com> Reviewed-by: ZeroHD <joey@ahines.net>ogp
parent
4c9b01e42a
commit
dcd1db1d4a
|
@ -108,13 +108,17 @@ class Discord(commands.Bot):
|
|||
|
||||
def run_bot(self):
|
||||
global discord_loop
|
||||
try:
|
||||
discord_loop.run_until_complete(self.start(self.token))
|
||||
except KeyboardInterrupt:
|
||||
logger.info("Bot received keyboard interrupt")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
logger.info('Bot encountered the following unhandled exception %s', e)
|
||||
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():
|
||||
|
|
Loading…
Reference in New Issue