Fix Interaction.channel being None in threads

This commit is contained in:
Nadir Chowdhury authored and GitHub committed 2021-07-01 07:49:44 -04:00
1 parent d001b9d0ee
commit 2d597e310b
3 files changed
+16 -7

No files matched your search

+6
View File
@@ -586,6 +586,12 @@ class Guild(Hashable):
channels.sort(key=lambda c: (c._sorting_bucket, c.position, c.id))
return as_list
def _resolve_channel(self, id: Optional[int], /) -> Optional[Union[GuildChannel, Thread]]:
if id is None:
return
return self._channels.get(id) or self._threads.get(id)
def get_channel(self, channel_id: int, /) -> Optional[GuildChannel]:
"""Returns a channel with the given ID.