mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Don't dispatch thread_join on extraneous THREAD_CREATE dispatches
This commit is contained in:
parent
bd369c76ea
commit
e13cbf4644
@ -709,14 +709,16 @@ class ConnectionState:
|
||||
|
||||
def parse_thread_create(self, data):
|
||||
guild_id = int(data['guild_id'])
|
||||
guild = self._get_guild(guild_id)
|
||||
guild: Optional[Guild] = self._get_guild(guild_id)
|
||||
if guild is None:
|
||||
log.debug('THREAD_CREATE referencing an unknown guild ID: %s. Discarding', guild_id)
|
||||
return
|
||||
|
||||
thread = Thread(guild=guild, data=data)
|
||||
has_thread = guild.get_thread(thread.id)
|
||||
guild._add_thread(thread)
|
||||
self.dispatch('thread_join', thread)
|
||||
if not has_thread:
|
||||
self.dispatch('thread_join', thread)
|
||||
|
||||
def parse_thread_update(self, data):
|
||||
guild_id = int(data['guild_id'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user