mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-22 19:06:44 +00:00
Fix crash with WEBHOOKS_UPDATE channel_id being nullable
This commit is contained in:
parent
95deb55332
commit
6a49dfcc0f
@ -1293,7 +1293,8 @@ class ConnectionState:
|
|||||||
_log.debug('WEBHOOKS_UPDATE referencing an unknown guild ID: %s. Discarding', data['guild_id'])
|
_log.debug('WEBHOOKS_UPDATE referencing an unknown guild ID: %s. Discarding', data['guild_id'])
|
||||||
return
|
return
|
||||||
|
|
||||||
channel = guild.get_channel(int(data['channel_id']))
|
channel_id = utils._get_as_snowflake(data, 'channel_id')
|
||||||
|
channel = guild.get_channel(channel_id) # type: ignore # None is okay here
|
||||||
if channel is not None:
|
if channel is not None:
|
||||||
self.dispatch('webhooks_update', channel)
|
self.dispatch('webhooks_update', channel)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user