Add support for message snapshots (forwarding) #126
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 aMessageReferenceType
Type propertyIMessageSnapshot
interface and Transient implementation - this type is very similar toIMessage
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