Add raw thread delete event

This commit is contained in:
LostLuma
2021-07-23 10:03:11 +02:00
parent fc51736b34
commit e4750c7105
3 changed files with 60 additions and 3 deletions

View File

@ -759,8 +759,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)