Document message types that can have a default message reference

This commit is contained in:
Jakub Kuczys
2025-02-24 11:03:24 +01:00
committed by GitHub
parent 0e4f06103e
commit 19f02c40b3
2 changed files with 27 additions and 7 deletions

View File

@ -610,6 +610,11 @@ class MessageReference:
.. versionadded:: 2.5
message_id: Optional[:class:`int`]
The id of the message referenced.
This can be ``None`` when this message reference was retrieved from
a system message of one of the following types:
- :attr:`MessageType.channel_follow_add`
- :attr:`MessageType.thread_created`
channel_id: :class:`int`
The channel id of the message referenced.
guild_id: Optional[:class:`int`]
@ -2010,9 +2015,16 @@ class Message(PartialMessage, Hashable):
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
type :attr:`MessageType.pins_add`, crossposted messages created by a
followed channel integration, or message replies.
The message that this message references. This is only applicable to
message replies (:attr:`MessageType.reply`), crossposted messages created by
a followed channel integration, forwarded messages, and messages of type:
- :attr:`MessageType.pins_add`
- :attr:`MessageType.channel_follow_add`
- :attr:`MessageType.thread_created`
- :attr:`MessageType.thread_starter_message`
- :attr:`MessageType.poll_result`
- :attr:`MessageType.context_menu_command`
.. versionadded:: 1.5