diff --git a/red.py b/red.py index 7fbc991e1..a2f6b5c4b 100644 --- a/red.py +++ b/red.py @@ -13,6 +13,8 @@ import sys import logging import aiohttp import importlib +import shutil +import traceback # # Red, a Discord bot by Twentysix, based on discord.py and its command extension @@ -528,10 +530,12 @@ if __name__ == '__main__': try: loop.run_until_complete(main()) except discord.LoginFailure: + traceback.print_exc() print("Invalid login credentials. Restart Red and configure it properly.") + shutil.copy('data/red/settings.json', 'data/red/settings.json-{}'.format(int(time.time()))) os.remove('data/red/settings.json') # Hopefully this won't backfire in case of discord servers' problems - except Exception as e: - print(e) + except: + traceback.print_exc() loop.run_until_complete(bot.logout()) finally: loop.close()