Add raw thread delete event

This commit is contained in:
Lilly Rose Berner
2022-04-22 06:42:39 +02:00
committed by GitHub
parent 222dd3cf5b
commit 3e8fa5a661
3 changed files with 63 additions and 3 deletions

View File

@@ -886,8 +886,10 @@ class ConnectionState:
_log.debug('THREAD_DELETE referencing an unknown guild ID: %s. Discarding', guild_id)
return
thread_id = int(data['id'])
thread = guild.get_thread(thread_id)
raw = RawThreadDeleteEvent(data)
raw.thread = thread = guild.get_thread(raw.thread_id)
self.dispatch('raw_thread_delete', raw)
if thread is not None:
guild._remove_thread(thread)
self.dispatch('thread_delete', thread)