aboutsummaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
authornickofolas <[email protected]>2021-07-28 19:00:43 -0500
committerGitHub <[email protected]>2021-07-28 20:00:43 -0400
commit0112c2819f68daffb4b78acebb9859379fc5b323 (patch)
treecfc24f1fa8a3c70c4aad4a8504ee0e4d0996a0c2 /discord
parentSet Thread.member/message_count (diff)
downloaddiscord.py-0112c2819f68daffb4b78acebb9859379fc5b323.tar.xz
discord.py-0112c2819f68daffb4b78acebb9859379fc5b323.zip
Fix PartialMessage rejecting Threads
Diffstat (limited to 'discord')
-rw-r--r--discord/message.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/discord/message.py b/discord/message.py
index f1443718..18c4658e 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -1632,8 +1632,15 @@ class PartialMessage(Hashable):
to_message_reference_dict = Message.to_message_reference_dict
def __init__(self, *, channel: PartialMessageableChannel, id: int):
- if channel.type not in (ChannelType.text, ChannelType.news, ChannelType.private):
- raise TypeError(f'Expected TextChannel or DMChannel not {type(channel)!r}')
+ if channel.type not in (
+ ChannelType.text,
+ ChannelType.news,
+ ChannelType.private,
+ ChannelType.news_thread,
+ ChannelType.public_thread,
+ ChannelType.private_thread
+ ):
+ raise TypeError(f'Expected TextChannel, DMChannel or Thread not {type(channel)!r}')
self.channel: PartialMessageableChannel = channel
self._state: ConnectionState = channel._state