Fix PartialMessage rejecting Threads

This commit is contained in:
nickofolas 2021-07-28 19:00:43 -05:00 committed by GitHub
parent 906c13d4f0
commit 0112c2819f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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