From 33a36e815f4976247de7f82890f4bc07ec5c2e11 Mon Sep 17 00:00:00 2001 From: Travis Grammer Date: Mon, 18 Mar 2024 21:48:50 +0000 Subject: [PATCH 1/2] add missing ApplicationCommand struct props --- interactions.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/interactions.go b/interactions.go index c562463af..65e31a067 100644 --- a/interactions.go +++ b/interactions.go @@ -29,6 +29,25 @@ const ( MessageApplicationCommand ApplicationCommandType = 3 ) +// ContextType represents the type of a application command's context. +type ContextType uint8 + +// Context types +const ( + GuildContextType ContextType = 0 + BotDMContextType ContextType = 1 + PrivateChannelContextType ContextType = 3 +) + +// IntegrationType represents the type of an application's supported integration +type IntegrationType uint8 + +// Integration types +const ( + GuildInstallIntegrationType IntegrationType = 0 + UserInstallIntegrationType IntegrationType = 1 +) + // ApplicationCommand represents an application's slash command. type ApplicationCommand struct { ID string `json:"id,omitempty"` @@ -44,6 +63,9 @@ type ApplicationCommand struct { DMPermission *bool `json:"dm_permission,omitempty"` NSFW *bool `json:"nsfw,omitempty"` + IntegrationTypes []IntegrationType `json:"integration_types,omitempty"` + Contexts []ContextType `json:"contexts,omitempty"` + // NOTE: Chat commands only. Otherwise it mustn't be set. Description string `json:"description,omitempty"` From a6a418e2ee46785ad4438df9a6a503e7fa8d7c83 Mon Sep 17 00:00:00 2001 From: Travis Grammer Date: Mon, 18 Mar 2024 23:52:18 +0000 Subject: [PATCH 2/2] reorder/fix structs --- interactions.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/interactions.go b/interactions.go index 65e31a067..f092a3122 100644 --- a/interactions.go +++ b/interactions.go @@ -29,18 +29,8 @@ const ( MessageApplicationCommand ApplicationCommandType = 3 ) -// ContextType represents the type of a application command's context. -type ContextType uint8 - -// Context types -const ( - GuildContextType ContextType = 0 - BotDMContextType ContextType = 1 - PrivateChannelContextType ContextType = 3 -) - // IntegrationType represents the type of an application's supported integration -type IntegrationType uint8 +type IntegrationType int // Integration types const ( @@ -48,6 +38,16 @@ const ( UserInstallIntegrationType IntegrationType = 1 ) +// ContextType represents the type of a application command's context. +type ContextType int + +// Context types +const ( + GuildContextType ContextType = 0 + BotDMContextType ContextType = 1 + PrivateChannelContextType ContextType = 2 +) + // ApplicationCommand represents an application's slash command. type ApplicationCommand struct { ID string `json:"id,omitempty"`