Browse Source

Create ScheduledEvent on cache miss in SCHEDULED_EVENT_DELETE

pull/10117/head
dolfies 1 month ago
committed by GitHub
parent
commit
a8b4eb1e9b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      discord/state.py

8
discord/state.py

@ -1553,12 +1553,8 @@ class ConnectionState(Generic[ClientT]):
def parse_guild_scheduled_event_delete(self, data: gw.GuildScheduledEventDeleteEvent) -> None:
guild = self._get_guild(int(data['guild_id']))
if guild is not None:
try:
scheduled_event = guild._scheduled_events.pop(int(data['id']))
except KeyError:
pass
else:
self.dispatch('scheduled_event_delete', scheduled_event)
scheduled_event = guild._scheduled_events.pop(int(data['id']), ScheduledEvent(state=self, data=data))
self.dispatch('scheduled_event_delete', scheduled_event)
else:
_log.debug('SCHEDULED_EVENT_DELETE referencing unknown guild ID: %s. Discarding.', data['guild_id'])

Loading…
Cancel
Save