Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for message snapshots (forwarding) #126

Merged
merged 3 commits into from
Nov 16, 2024

Conversation

QuantumToasted
Copy link
Contributor

@QuantumToasted QuantumToasted commented Nov 8, 2024

Description

https://discord.com/developers/docs/resources/message#message-reference-content-attribution-forwards

This PR adds support for receiving and sending message snapshots (forwarded messages).

Notable changes:

  • MessageReferenceType enum added, with values Reply (0) and Forward (1)
  • IMessageReference now contains a MessageReferenceType Type property
  • Added IMessageSnapshot interface and Transient implementation - this type is very similar to IMessage but lacks an author property. I'm unsure if it would be worth it to abstract common data between the two types further, so I elected not to.
  • MessageJsonModel is used as the model for snapshots - this introduces a "breaking" change where Author is optional (snapshots lack an author). Several models were adjusted where Author is known to have a value to simply use .Value now.

Received forwarded messages can be found via IUserMessage#MessageSnapshots, and can be sent via a LocalMessageReference with Type: Forward (not supported in app command responses)

Checklist

  • I discussed this PR with the maintainer(s) prior to opening it.
  • I read the contributing guidelines.
  • I tested the changes in this PR.

@Quahu Quahu merged commit 824b08b into Quahu:master Nov 16, 2024
1 check passed
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.

2 participants