From 508e5e24b6fdc5646aa065f3a57c83c3b7944ccc Mon Sep 17 00:00:00 2001 From: mlnrDev Date: Fri, 26 Apr 2024 13:29:42 +0200 Subject: [PATCH] support multiple snapshots https://github.com/discord/discord-api-docs/pull/6818/commits/14e1fa742142ff85f6c582d81e8c62ab810e1f0d --- discord/message.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/discord/message.go b/discord/message.go index 2f1031db..0a2ff180 100644 --- a/discord/message.go +++ b/discord/message.go @@ -102,7 +102,7 @@ type Message struct { Type MessageType `json:"type"` Flags MessageFlags `json:"flags"` MessageReference *MessageReference `json:"message_reference,omitempty"` - MessageSnapshot *Message `json:"message_snapshot,omitempty"` + MessageSnapshots []MessageSnapshot `json:"message_snapshots,omitempty"` Interaction *MessageInteraction `json:"interaction,omitempty"` WebhookID *snowflake.ID `json:"webhook_id,omitempty"` Activity *MessageActivity `json:"activity,omitempty"` @@ -414,6 +414,20 @@ const ( MessageReferenceTypeForward ) +type MessageSnapshot struct { + Message PartialMessage `json:"message"` + GuildID *snowflake.ID `json:"guild_id"` +} + +type PartialMessage struct { + Content string `json:"content,omitempty"` + Embeds []Embed `json:"embeds,omitempty"` + Attachments []Attachment `json:"attachments"` + CreatedAt time.Time `json:"timestamp"` + EditedTimestamp *time.Time `json:"edited_timestamp"` + Flags MessageFlags `json:"flags"` +} + // MessageInteraction is sent on the Message object when the message is a response to an interaction type MessageInteraction struct { ID snowflake.ID `json:"id"`