Refractor bot start code

This commit is contained in:
Jeremy Zhang 2020-02-17 14:40:53 -08:00
parent 6d7ccdbec7
commit e9ad93c929

View File

@ -52,18 +52,6 @@ class Titan(discord.AutoShardedClient):
except: # Can be ignored
pass
def run(self):
try:
self.loop.run_until_complete(self.start())
except discord.errors.LoginFailure:
print("Invalid bot token in config!")
finally:
try:
self._cleanup()
except Exception as e:
print("Error in cleanup:", e)
self.loop.close()
async def start(self):
await self.redisqueue.connect()
await super().start(config["bot-token"])