Added some sleep during guild join to make sure things are in order

This commit is contained in:
Jeremy Zhang 2017-05-21 20:40:34 +00:00
parent b7b4187094
commit 6480df1b57

View File

@ -103,6 +103,7 @@ class Titan(discord.Client):
async def on_server_join(self, guild): async def on_server_join(self, guild):
await asyncio.sleep(1) await asyncio.sleep(1)
if not guild.me.server_permissions.administrator: if not guild.me.server_permissions.administrator:
await asyncio.sleep(1)
await self.leave_server(guild) await self.leave_server(guild)
return return
@ -112,7 +113,7 @@ class Titan(discord.Client):
await self.database.push_message(message) await self.database.push_message(message)
for member in guild.members: for member in guild.members:
await self.database.update_guild_member(member, True, False) await self.database.update_guild_member(member, True, False)
banned = self.get_bans(guild) banned = await self.get_bans(guild)
for ban in banned: for ban in banned:
await self.database.update_guild_member(ban, False, True) await self.database.update_guild_member(ban, False, True)