Fix Client.fetch_channel not returning Thread

This commit is contained in:
Alex Nørgaard
2021-07-04 02:35:31 +01:00
committed by GitHub
parent 097b6064f1
commit d1dc41ec2f
7 changed files with 22 additions and 15 deletions

View File

@@ -287,7 +287,7 @@ class Guild(Hashable):
self._members[member.id] = member
def _store_thread(self, payload: ThreadPayload, /) -> Thread:
thread = Thread(guild=self, data=payload)
thread = Thread(guild=self, state=self._state, data=payload)
self._threads[thread.id] = thread
return thread
@@ -466,7 +466,7 @@ class Guild(Hashable):
if 'threads' in data:
threads = data['threads']
for thread in threads:
self._add_thread(Thread(guild=self, data=thread))
self._add_thread(Thread(guild=self, state=self._state, data=thread))
@property
def channels(self) -> List[GuildChannel]: