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

@ -50,19 +50,7 @@ class Titan(discord.AutoShardedClient):
self.loop.run_until_complete(gathered) self.loop.run_until_complete(gathered)
gathered.exception() gathered.exception()
except: # Can be ignored except: # Can be ignored
pass 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): async def start(self):
await self.redisqueue.connect() await self.redisqueue.connect()