aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraftSpider <[email protected]>2019-02-15 11:26:40 -0500
committerRapptz <[email protected]>2019-02-18 03:47:57 -0500
commit8e97a0a248309e251fa830ac709f8dc5841dc9e4 (patch)
tree8f8887ee47a84b4a50658f276db69fbf71e797c0
parentAdd guild_integrations_update event (diff)
downloaddiscord.py-8e97a0a248309e251fa830ac709f8dc5841dc9e4.tar.xz
discord.py-8e97a0a248309e251fa830ac709f8dc5841dc9e4.zip
Log unknown channel warning in WEBHOOK_UPDATE
-rw-r--r--discord/state.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/state.py b/discord/state.py
index 36e33f57..b49f3141 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -532,7 +532,6 @@ class ConnectionState:
log.warning('CHANNEL_CREATE referencing an unknown guild ID: %s. Discarding.', guild_id)
return
-
def parse_channel_pins_update(self, data):
channel_id = int(data['channel_id'])
channel = self.get_channel(channel_id)
@@ -799,8 +798,10 @@ class ConnectionState:
def parse_webhooks_update(self, data):
channel = self.get_channel(int(data['channel_id']))
- if channel:
+ if channel is not None:
self.dispatch('webhooks_update', channel)
+ else:
+ log.warning('WEBHOOKS_UPDATE referencing an unknown channel ID: %s. Discarding.', data['channel_id'])
def parse_voice_state_update(self, data):
guild = self._get_guild(utils._get_as_snowflake(data, 'guild_id'))