@classmethod
def from_message(cls, message: PartialMessage, *, fail_if_not_exists: bool=True) -> Self:
    'Creates a :class:`MessageReference` from an existing :class:`~discord.Message`.\n\n        .. versionadded:: 1.6\n\n        Parameters\n        ----------\n        message: :class:`~discord.Message`\n            The message to be converted into a reference.\n        fail_if_not_exists: :class:`bool`\n            Whether replying to the referenced message should raise :class:`HTTPException`\n            if the message no longer exists or Discord could not fetch the message.\n\n            .. versionadded:: 1.7\n\n        Returns\n        -------\n        :class:`MessageReference`\n            A reference to the message.\n        '
    self = cls(message_id=message.id, channel_id=message.channel.id, guild_id=getattr(message.guild, 'id', None), fail_if_not_exists=fail_if_not_exists)
    self._state = message._state
    return self
Creates a :class:`MessageReference` from an existing :class:`~discord.Message`.

.. versionadded:: 1.6

Parameters
----------
message: :class:`~discord.Message`
    The message to be converted into a reference.
fail_if_not_exists: :class:`bool`
    Whether replying to the referenced message should raise :class:`HTTPException`
    if the message no longer exists or Discord could not fetch the message.

    .. versionadded:: 1.7

Returns
-------
:class:`MessageReference`
    A reference to the message.
@classmethod
def from_message(cls, message: PartialMessage, *, fail_if_not_exists: bool=True) -> Self:
    'Creates a :class:`MessageReference` from an existing :class:`~discord.Message`.\n\n        .. versionadded:: 1.6\n\n        Parameters\n        ----------\n        message: :class:`~discord.Message`\n            The message to be converted into a reference.\n        fail_if_not_exists: :class:`bool`\n            Whether replying to the referenced message should raise :class:`HTTPException`\n            if the message no longer exists or Discord could not fetch the message.\n\n            .. versionadded:: 1.7\n\n        Returns\n        -------\n        :class:`MessageReference`\n            A reference to the message.\n        '
    self = cls(message_id=message.id, channel_id=message.channel.id, guild_id=getattr(message.guild, 'id', None), fail_if_not_exists=fail_if_not_exists)
    self._state = message._state
    return self