Add new on_thread_create event

This commit is contained in:
Josh
2022-04-04 21:22:21 +10:00
committed by GitHub
parent b561024163
commit deb7958797
4 changed files with 24 additions and 3 deletions

View File

@@ -850,7 +850,10 @@ class ConnectionState:
has_thread = guild.get_thread(thread.id)
guild._add_thread(thread)
if not has_thread:
self.dispatch('thread_join', thread)
if data.get('newly_created'):
self.dispatch('thread_create', thread)
else:
self.dispatch('thread_join', thread)
def parse_thread_update(self, data: gw.ThreadUpdateEvent) -> None:
guild_id = int(data['guild_id'])