mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-22 00:13:01 +00:00
Fix Interaction.channel being None in threads
This commit is contained in:
@@ -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.
|
||||
|
||||
|
Reference in New Issue
Block a user