mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 23:15:48 +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'])
|
||||
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:
|
||||
self.dispatch('webhooks_update', channel)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user