diff options
| author | Rapptz <[email protected]> | 2021-05-02 23:28:30 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-06-08 07:25:40 -0400 |
| commit | ac95b8b85b5cf5d75307cb0d6c0e2541a3920dbc (patch) | |
| tree | 4a23b3c56a9143650ff72e13ca9925042249e6e0 /discord/state.py | |
| parent | TextChannel.archived_threads is not a coroutine (diff) | |
| download | discord.py-ac95b8b85b5cf5d75307cb0d6c0e2541a3920dbc.tar.xz discord.py-ac95b8b85b5cf5d75307cb0d6c0e2541a3920dbc.zip | |
Allow Message.channel to be a thread
Diffstat (limited to 'discord/state.py')
| -rw-r--r-- | discord/state.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/state.py b/discord/state.py index 7c1183d7..e9e4fa4d 100644 --- a/discord/state.py +++ b/discord/state.py @@ -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): |