From fd5a218d7c2c1258aa98ee58f4368dc2a7cc6e3c Mon Sep 17 00:00:00 2001 From: n6ck <90283633+n6ck@users.noreply.github.com> Date: Sun, 22 Feb 2026 19:12:39 -0800 Subject: [PATCH] Add Message.is_forwardable to check if a message can be forwarded --- discord/message.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/discord/message.py b/discord/message.py index 7b209fc59..19d78dd53 100644 --- a/discord/message.py +++ b/discord/message.py @@ -3051,3 +3051,30 @@ class Message(PartialMessage, Hashable): The newly edited message. """ return await self.edit(attachments=[a for a in self.attachments if a not in attachments]) + + def is_forwardable(self) -> bool: + """:class:`bool`: Whether the message can be forwarded using :meth:`Message.forward`. + + A message is forwardable only if it is a basic message type and does not + contain a poll, call, or activity, and is not a system message. + + .. versionadded:: 2.7 + """ + if self.type not in ( + MessageType.default, + MessageType.reply, + MessageType.chat_input_command, + MessageType.context_menu_command, + ): + return False + + if self.poll is not None: + return False + + if self.call is not None: + return False + + if self.activity is not None: + return False + + return True