From c219eb07a3b9aaf9e215ae019de02cd3af0fc704 Mon Sep 17 00:00:00 2001 From: Snipy7374 <100313469+Snipy7374@users.noreply.github.com> Date: Sun, 28 Apr 2024 00:03:08 +0200 Subject: [PATCH] add documentation for message forward method --- disnake/message.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/disnake/message.py b/disnake/message.py index 9cf277d8a5..548184f6e8 100644 --- a/disnake/message.py +++ b/disnake/message.py @@ -2177,6 +2177,35 @@ async def reply( async def forward( self, content: Optional[str] = None, *, fail_if_not_exists: bool = True, **kwargs: Any ) -> Message: + """|coro| + + A shortcut method to :meth:`.abc.Messageable.send` to forward a + :class:`.Message`. + + .. versionadded:: 2.10 + + Parameters + ---------- + fail_if_not_exists: :class:`bool` + Whether replying using the message reference should raise :exc:`~disnake.HTTPException` + if the message no longer exists or Discord could not fetch the message. + + Raises + ------ + HTTPException + Sending the message failed. + Forbidden + You do not have the proper permissions to send the message. + TypeError + You specified both ``embed`` and ``embeds``, or ``file`` and ``files``, or ``view`` and ``components``. + ValueError + The ``files`` or ``embeds`` list is too large. + + Returns + ------- + :class:`.Message` + The message that was sent. + """ if not fail_if_not_exists: reference = MessageReference.from_message( self, type=MessageReferenceType.forward, fail_if_not_exists=False