Skip to content

Commit

Permalink
fix inconsistent interaction response types & response method naming
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Sep 29, 2023
1 parent 2570fd3 commit d0d82ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion discord/interaction_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const (
InteractionResponseTypeDeferredCreateMessage
InteractionResponseTypeDeferredUpdateMessage
InteractionResponseTypeUpdateMessage
InteractionResponseTypeApplicationCommandAutocompleteResult
InteractionResponseTypeAutocompleteResult
InteractionResponseTypeModal
InteractionResponseTypePremiumRequired
)
Expand Down
14 changes: 7 additions & 7 deletions events/interaction_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}

Expand Down Expand Up @@ -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...)
}

Expand All @@ -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.
Expand Down

0 comments on commit d0d82ce

Please sign in to comment.