From eb579c8e94e0422b527488c8bb44bf7967f4a089 Mon Sep 17 00:00:00 2001 From: Samuel Hernandez Date: Fri, 19 Aug 2022 00:52:14 -0400 Subject: [PATCH] api: remove InteractionResponseFlags in favor of discord.MessageFlags See docs: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-messages This is an API change. Use the following commands to update your projects: $ gofmt -w -r 'api.InteractionResponseFlags -> discord.MessageFlags' $ gofmt -w -r 'api.EphemeralResponse -> discord.EphemeralMessage' --- api/interaction.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/api/interaction.go b/api/interaction.go index 65f2ce7..0f669bf 100644 --- a/api/interaction.go +++ b/api/interaction.go @@ -28,14 +28,6 @@ const ( ModalResponse ) -// InteractionResponseFlags implements flags for an -// InteractionApplicationCommandCallbackData. -// -// https://discord.com/developers/docs/interactions/slash-commands#interaction-response-object-interaction-application-command-callback-data-flags -type InteractionResponseFlags uint - -const EphemeralResponse InteractionResponseFlags = 64 - type InteractionResponse struct { Type InteractionResponseType `json:"type"` Data *InteractionResponseData `json:"data,omitempty"` @@ -69,7 +61,8 @@ type InteractionResponseData struct { // AllowedMentions are the allowed mentions for the message. AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"` // Flags are the interaction application command callback data flags. - Flags InteractionResponseFlags `json:"flags,omitempty"` + // Only SuppressEmbeds and EphemeralMessage may be set. + Flags discord.MessageFlags `json:"flags,omitempty"` // Files represents a list of files to upload. This will not be // JSON-encoded and will only be available through WriteMultipart.