discord.py icon indicating copy to clipboard operation
discord.py copied to clipboard

Add support for message snapshots used in message forwarding

Open redmvc opened this issue 1 year ago • 2 comments

Summary

Message forwarding was introduced on July 18, 2024. Messages now have a new optional parameter, message_snapshots, which is an array of Message Snapshots containing immutable snapshots of a message being forwarded. Such messages will, additionally, always have a reference to the message being forwarded, and that reference will have type = 1.

This PR adds a MessageSnapshot class and a message_snapshots parameter to the Message class. It also adds the type parameter to the MessageReference class, in order to track whether a reference is a reply or a forward.

Checklist

  • [x] If code changes were made then they have been tested.
    • [x] I have updated the documentation to reflect the changes.
  • [ ] This PR fixes an issue.
  • [x] 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, ...)

redmvc avatar Jul 22 '24 16:07 redmvc

Can't this use the existing Message class? With a potential _from_snapshot classmethod

Soheab avatar Jul 22 '24 16:07 Soheab

Message snapshots don't have all Message information; in particular, they don't have an author.

redmvc avatar Jul 22 '24 16:07 redmvc

As new PR opened on Discord's side, this is missing following fields in MessageSnapshot: stickers, sticker_items, and components.

codeofandrin avatar Aug 31 '24 15:08 codeofandrin

Sorry, it's unlikely I'll be able to resume work on this PR anytime soon. If anybody wants to take the code, I encourage it.

redmvc avatar Sep 28 '24 19:09 redmvc

Superseded by #9950

Rapptz avatar Oct 09 '24 21:10 Rapptz