From 134f49d00ff1842210150007387bdaae84b4b113 Mon Sep 17 00:00:00 2001 From: Hamza Ali Date: Sat, 12 Jun 2021 15:49:43 +0700 Subject: [PATCH] discord: Add Flags field to InteractionResponseData --- api/interaction.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/api/interaction.go b/api/interaction.go index ac9d6d9..b152307 100644 --- a/api/interaction.go +++ b/api/interaction.go @@ -28,15 +28,22 @@ type InteractionResponse struct { Data *InteractionResponseData `json:"data,omitempty"` } +// InteractionResponseFlags implements flags for an InteractionApplicationCommandCallbackData. +// https://discord.com/developers/docs/interactions/slash-commands#interaction-response-interactionapplicationcommandcallbackdata +type InteractionResponseFlags uint + +const EphemeralResponse InteractionResponseFlags = 64 + // InteractionResponseData is InteractionApplicationCommandCallbackData in the // official documentation. type InteractionResponseData struct { - TTS option.NullableBool `json:"tts,omitempty"` - Content option.NullableString `json:"content,omitempty"` - Components *[]discord.Component `json:"components,omitempty"` - Embeds *[]discord.Embed `json:"embeds,omitempty"` - AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"` - Files []sendpart.File `json:"-"` + TTS option.NullableBool `json:"tts,omitempty"` + Content option.NullableString `json:"content,omitempty"` + Components *[]discord.Component `json:"components,omitempty"` + Embeds *[]discord.Embed `json:"embeds,omitempty"` + AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"` + Flags InteractionResponseFlags `json:"flags,omitempty"` + Files []sendpart.File `json:"-"` } // RespondInteraction responds to an incoming interaction. It is also known as