Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions discord/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -3053,3 +3053,30 @@ async def remove_attachments(self, *attachments: Attachment) -> Message:
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 getattr(self, 'poll', None) is not None:
return False

if getattr(self, 'call', None) is not None:
return False

if getattr(self, 'activity', None) is not None:
return False

return True
Loading