Skip to content

Conversation

@n6ck
Copy link
Contributor

@n6ck n6ck commented Nov 22, 2025

Summary

Adds a new method Message.is_forwardable to check if a message can be forwarded with Message.forward
Helps to avoid failed forwarding attempts by providing a simple boolean check
Inspired by Message.is_system

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@pythonmcpi
Copy link
Contributor

Is there an upstream docs page listing the criteria of whether a message is forwardable?

@Sacul0457
Copy link
Contributor

Sacul0457 commented Nov 22, 2025

given this is accepted, I think this should be in MessageType, not in Message. Similar to MessageType.is_deletable, this avoids implying that the message can be forwarded anywhere, regardless of permission.

But at the same time, you can't check for polls/activity etc, so...

Also, the attributes should never be missing afaik, you can just do if self.poll is not None instead of the getattr

@n6ck
Copy link
Contributor Author

n6ck commented Nov 22, 2025

Is there an upstream docs page listing the criteria of whether a message is forwardable?

https://discord.com/developers/docs/resources/message#message-reference-types

@n6ck
Copy link
Contributor Author

n6ck commented Nov 22, 2025

given this is accepted, I think this should be in MessageType, not in Message. Similar to MessageType.is_deletable, this avoids implying that the message can be forwarded anywhere, regardless of permission.

But at the same time, you can't check for polls/activity etc, so...

Also, the attributes should never be missing afaik, you can just do if self.poll is not None instead of the getattr

Good idea
As for getattr, self.call can be missing as I did come across that when testing for this, which is why I put that
(not even sure what self.call is tbh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants