Only act upon servers for channel create and remove

This commit is contained in:
Jeremy Zhang 2018-01-25 11:20:56 +00:00
parent ff81c5009d
commit a2f378da57

View File

@ -170,12 +170,14 @@ class Titan(discord.Client):
await self.socketio.on_guild_role_update(roleafter) await self.socketio.on_guild_role_update(roleafter)
async def on_channel_delete(self, channel): async def on_channel_delete(self, channel):
await self.database.update_guild(channel.server) if channel.server:
await self.socketio.on_channel_delete(channel) await self.database.update_guild(channel.server)
await self.socketio.on_channel_delete(channel)
async def on_channel_create(self, channel): async def on_channel_create(self, channel):
await self.database.update_guild(channel.server) if channel.server:
await self.socketio.on_channel_create(channel) await self.database.update_guild(channel.server)
await self.socketio.on_channel_create(channel)
async def on_channel_update(self, channelbefore, channelafter): async def on_channel_update(self, channelbefore, channelafter):
await self.database.update_guild(channelafter.server) await self.database.update_guild(channelafter.server)