Fix channel deletion not removing associated threads

This commit is contained in:
Lilly Rose Berner
2024-05-05 05:23:59 +02:00
committed by GitHub
parent 0b4263e697
commit 0ee1794c6d
3 changed files with 27 additions and 4 deletions

View File

@ -831,6 +831,12 @@ class ConnectionState(Generic[ClientT]):
guild._scheduled_events.pop(s.id)
self.dispatch('scheduled_event_delete', s)
threads = guild._remove_threads_by_channel(channel_id)
for thread in threads:
self.dispatch('thread_delete', thread)
self.dispatch('raw_thread_delete', RawThreadDeleteEvent._from_thread(thread))
def parse_channel_update(self, data: gw.ChannelUpdateEvent) -> None:
channel_type = try_enum(ChannelType, data.get('type'))
channel_id = int(data['id'])