Populate msgs on server join and remove on leave

This commit is contained in:
Jeremy Zhang
2017-05-08 20:19:45 -07:00
parent 4bb559420f
commit a621fa8b0a
2 changed files with 9 additions and 0 deletions

View File

@ -84,6 +84,9 @@ class Titan(discord.Client):
async def on_server_join(self, guild):
await self.database.update_guild(guild)
for channel in guild.channels:
async for message in self.logs_from(channel, limit=50, reverse=True):
await self.database.push_message(message)
async def on_server_remove(self, guild):
await self.database.remove_guild(guild)