aboutsummaryrefslogtreecommitdiff
path: root/discord/message.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-08-10 09:24:49 -0400
committerRapptz <[email protected]>2021-08-10 09:24:49 -0400
commit1279510194441135070a294254365db3dbf03897 (patch)
treed12b5f2323e1e650ebc22ae7e9d161439e18ea08 /discord/message.py
parentFill in ConnectionState.user via HTTPClient.static_login (diff)
downloaddiscord.py-1279510194441135070a294254365db3dbf03897.tar.xz
discord.py-1279510194441135070a294254365db3dbf03897.zip
Add support for PartialMessageable instances
This allows library users to send messages to channels without fetching it first.
Diffstat (limited to 'discord/message.py')
-rw-r--r--discord/message.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/discord/message.py b/discord/message.py
index 270ac9e9..d752c8c7 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -70,7 +70,7 @@ if TYPE_CHECKING:
from .abc import GuildChannel, PartialMessageableChannel, MessageableChannel
from .components import Component
from .state import ConnectionState
- from .channel import TextChannel, GroupChannel, DMChannel
+ from .channel import TextChannel, GroupChannel, DMChannel, PartialMessageable
from .mentions import AllowedMentions
from .user import User
from .role import Role
@@ -520,7 +520,7 @@ 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:`Thread`, :class:`DMChannel`, :class:`GroupChannel`]
+ channel: Union[:class:`TextChannel`, :class:`Thread`, :class:`DMChannel`, :class:`GroupChannel`, :class:`PartialMessageable`]
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`]
@@ -646,7 +646,7 @@ class Message(Hashable):
self,
*,
state: ConnectionState,
- channel: Union[TextChannel, Thread, DMChannel, GroupChannel],
+ channel: Union[TextChannel, Thread, DMChannel, GroupChannel, PartialMessageable],
data: MessagePayload,
):
self._state: ConnectionState = state