aboutsummaryrefslogtreecommitdiff
path: root/discord/message.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-05-02 23:28:30 -0400
committerRapptz <[email protected]>2021-06-08 07:25:40 -0400
commitac95b8b85b5cf5d75307cb0d6c0e2541a3920dbc (patch)
tree4a23b3c56a9143650ff72e13ca9925042249e6e0 /discord/message.py
parentTextChannel.archived_threads is not a coroutine (diff)
downloaddiscord.py-ac95b8b85b5cf5d75307cb0d6c0e2541a3920dbc.tar.xz
discord.py-ac95b8b85b5cf5d75307cb0d6c0e2541a3920dbc.zip
Allow Message.channel to be a thread
Diffstat (limited to 'discord/message.py')
-rw-r--r--discord/message.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/discord/message.py b/discord/message.py
index dc240d29..06d7157e 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -80,6 +80,7 @@ __all__ = (
'DeletedReferencedMessage',
)
+
def convert_emoji_reaction(emoji):
if isinstance(emoji, Reaction):
emoji = emoji.emoji
@@ -513,8 +514,8 @@ class Message(Hashable):
This is not stored long term within Discord's servers and is only used ephemerally.
embeds: List[:class:`Embed`]
A list of embeds the message has.
- channel: Union[:class:`TextChannel`, :class:`DMChannel`, :class:`GroupChannel`]
- The :class:`TextChannel` that the message was sent from.
+ channel: Union[:class:`TextChannel`, :class:`Thread`, :class:`DMChannel`, :class:`GroupChannel`]
+ The :class:`TextChannel` or :class:`Thread` that the message was sent from.
Could be a :class:`DMChannel` or :class:`GroupChannel` if it's a private message.
reference: Optional[:class:`~discord.MessageReference`]
The message that this message references. This is only applicable to messages of
@@ -632,7 +633,7 @@ class Message(Hashable):
self,
*,
state: ConnectionState,
- channel: Union[TextChannel, DMChannel, GroupChannel],
+ channel: Union[TextChannel, Thread, DMChannel, GroupChannel],
data: MessagePayload,
):
self._state = state
@@ -850,7 +851,7 @@ class Message(Hashable):
def _handle_components(self, components: List[ComponentPayload]):
self.components = [_component_factory(d) for d in components]
- def _rebind_channel_reference(self, new_channel: Union[TextChannel, DMChannel, GroupChannel]) -> None:
+ def _rebind_channel_reference(self, new_channel: Union[TextChannel, Thread, DMChannel, GroupChannel]) -> None:
self.channel = new_channel
try: