Allow Message.channel to be a thread
This commit is contained in:
@ -380,7 +380,7 @@ class ConnectionState:
|
||||
channel = DMChannel._from_message(self, channel_id)
|
||||
guild = None
|
||||
else:
|
||||
channel = guild and guild.get_channel(channel_id)
|
||||
channel = guild and (guild.get_channel(channel_id) or guild.get_thread(channel_id))
|
||||
|
||||
return channel or Object(id=channel_id), guild
|
||||
|
||||
@ -1181,7 +1181,7 @@ class AutoShardedConnectionState(ConnectionState):
|
||||
new_guild = self._get_guild(msg.guild.id)
|
||||
if new_guild is not None and new_guild is not msg.guild:
|
||||
channel_id = msg.channel.id
|
||||
channel = new_guild.get_channel(channel_id) or Object(id=channel_id)
|
||||
channel = new_guild.get_channel(channel_id) or new_guild.get_thread(channel_id) or Object(id=channel_id)
|
||||
msg._rebind_channel_reference(channel)
|
||||
|
||||
async def chunker(self, guild_id, query='', limit=0, presences=False, *, shard_id=None, nonce=None):
|
||||
|
Reference in New Issue
Block a user