Skip to content

Add Inline Replies in response to #676

Mateusz Brawański requested to merge github/fork/VelvetThePanda/master into master

Created by: VelvetThePanda

Summary

Addresses #676 (closed). Adds Inline Replies to messages.

Details

In order to address recent changes to the Discord API which added inline replies this PR is to add replies for use by the client. This also adds a way to parse the payloads from Discord which contain ReferencedMessage which is the official way to get messages in V8. In V6 this requires using the Reference to get the message. This PR also adds the message replied to into the cache if it isn't already there.

Changes proposed

  • Add the Message ID parameter to RespondAsync on both the DiscordMessage and the CommandContext as the message to reply to.
  • Add the Message ID parameter to CreateMessageAsync as the message to reply to.
  • Add the Message ID parameter to SendMessageAsync on the DiscordClient and the DiscordChannel as the message to reply to.
  • Add the Mention parameter to SendMessageAsync and RespondAsync as to whether a reply should ping the user replied to or not.
  • Add test commands to the test bot to test replying to messages
  • [TODO] Add test commands to test that ReferenceMessages are parsed correctly.
  • Extract methods from the OnMessageCreateEventAsync and OnMessageUpdateEventAsync that are used for both events and to populate the final fields in the ReferenceMessage
  • Add Mention Property to DiscordMentions object
  • Add ReferencedMessage property to the DiscordMessage object in prep for the move to V8.
  • Make ChannelId nullable in the DiscordMessageReference
  • Add RepliedUserMention struct
  • Add new Reply message type to MessageType enum in preparation for the move to V8
  • Add MessageReference to RestChannelMessageCreatePayload
  • Extract methods from PrepareMessage in DiscordApiClient to use on both the referenced message and the message.

Notes

N/A

Merge request reports

Loading