From 038597852018640056b7540a19676af9db441449 Mon Sep 17 00:00:00 2001 From: Daniel Mason Date: Mon, 23 Mar 2020 19:45:55 +1300 Subject: [PATCH] Add exception to handle crap --- bot.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index a456ab4..8783e0c 100644 --- a/bot.py +++ b/bot.py @@ -18,5 +18,10 @@ class MyClient(discord.Client): await channel.send(message.content) load_dotenv() -client = MyClient() -client.run(os.getenv("DISCORD_TOKEN"), bot=False) +while True: + try: + client = MyClient() + client.run(os.getenv("DISCORD_TOKEN"), bot=False) + except: + print("Error Occurred... retrying") +