aboutsummaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
authorJeremy Zhang <[email protected]>2018-08-23 06:49:53 +0000
committerRapptz <[email protected]>2018-09-15 18:28:57 -0400
commitd092c6635b69335d0d6aa174868f0eca08c50fb5 (patch)
tree0a922440234ea841f9ecd7b9d5099d17f910f6fa /discord
parentSimple parser for WEBHOOKS_UPDATE (diff)
downloaddiscord.py-d092c6635b69335d0d6aa174868f0eca08c50fb5.tar.xz
discord.py-d092c6635b69335d0d6aa174868f0eca08c50fb5.zip
Fix webhook_update from code review
Diffstat (limited to 'discord')
-rw-r--r--discord/state.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/state.py b/discord/state.py
index 28c6feb0..ea6b89de 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -780,8 +780,9 @@ class ConnectionState:
self.process_listeners(ListenerType.chunk, guild, len(members))
def parse_webhooks_update(self, data):
- channel = self.get_channel(int(data["channel_id"]))
- self.dispatch("webhooks_update", channel)
+ channel = self.get_channel(int(data['channel_id']))
+ if channel:
+ self.dispatch('webhooks_update', channel)
def parse_voice_state_update(self, data):
guild = self._get_guild(utils._get_as_snowflake(data, 'guild_id'))