From d0d82cecaae2390b150f169402c8915190c6f7fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CF=80?= Date: Fri, 29 Sep 2023 15:01:46 +0200 Subject: [PATCH] fix inconsistent interaction response types & response method naming --- discord/interaction_response.go | 2 +- events/interaction_events.go | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/discord/interaction_response.go b/discord/interaction_response.go index 5b8c0c1c..dd4664cc 100644 --- a/discord/interaction_response.go +++ b/discord/interaction_response.go @@ -12,7 +12,7 @@ const ( InteractionResponseTypeDeferredCreateMessage InteractionResponseTypeDeferredUpdateMessage InteractionResponseTypeUpdateMessage - InteractionResponseTypeApplicationCommandAutocompleteResult + InteractionResponseTypeAutocompleteResult InteractionResponseTypeModal InteractionResponseTypePremiumRequired ) diff --git a/events/interaction_events.go b/events/interaction_events.go index c72d58ec..2f04e250 100644 --- a/events/interaction_events.go +++ b/events/interaction_events.go @@ -56,8 +56,8 @@ func (e *ApplicationCommandInteractionCreate) DeferCreateMessage(ephemeral bool, return e.Respond(discord.InteractionResponseTypeDeferredCreateMessage, data, opts...) } -// CreateModal responds to the interaction with a new modal. -func (e *ApplicationCommandInteractionCreate) CreateModal(modalCreate discord.ModalCreate, opts ...rest.RequestOpt) error { +// Modal responds to the interaction with a new modal. +func (e *ApplicationCommandInteractionCreate) Modal(modalCreate discord.ModalCreate, opts ...rest.RequestOpt) error { return e.Respond(discord.InteractionResponseTypeModal, modalCreate, opts...) } @@ -107,8 +107,8 @@ func (e *ComponentInteractionCreate) DeferUpdateMessage(opts ...rest.RequestOpt) return e.Respond(discord.InteractionResponseTypeDeferredUpdateMessage, nil, opts...) } -// CreateModal responds to the interaction with a new modal. -func (e *ComponentInteractionCreate) CreateModal(modalCreate discord.ModalCreate, opts ...rest.RequestOpt) error { +// Modal responds to the interaction with a new modal. +func (e *ComponentInteractionCreate) Modal(modalCreate discord.ModalCreate, opts ...rest.RequestOpt) error { return e.Respond(discord.InteractionResponseTypeModal, modalCreate, opts...) } @@ -134,9 +134,9 @@ func (e *AutocompleteInteractionCreate) Guild() (discord.Guild, bool) { return discord.Guild{}, false } -// Result responds to the interaction with a slice of choices. -func (e *AutocompleteInteractionCreate) Result(choices []discord.AutocompleteChoice, opts ...rest.RequestOpt) error { - return e.Respond(discord.InteractionResponseTypeApplicationCommandAutocompleteResult, discord.AutocompleteResult{Choices: choices}, opts...) +// AutocompleteResult responds to the interaction with a slice of choices. +func (e *AutocompleteInteractionCreate) AutocompleteResult(choices []discord.AutocompleteChoice, opts ...rest.RequestOpt) error { + return e.Respond(discord.InteractionResponseTypeAutocompleteResult, discord.AutocompleteResult{Choices: choices}, opts...) } // ModalSubmitInteractionCreate indicates that a new modal submit interaction has been created.