mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-03-25 19:39:52 +00:00
api: Allow all types for api choices
This commit is contained in:
parent
8732dc1ff6
commit
33fbc1a1a2
|
@ -78,7 +78,7 @@ type InteractionResponseData struct {
|
||||||
// Choices are the results to display on autocomplete interaction events.
|
// Choices are the results to display on autocomplete interaction events.
|
||||||
//
|
//
|
||||||
// During all other events, this should not be provided.
|
// During all other events, this should not be provided.
|
||||||
Choices *[]AutocompleteChoice `json:"choices"`
|
Choices AutocompleteChoices `json:"choices"`
|
||||||
|
|
||||||
// CustomID used with the modal
|
// CustomID used with the modal
|
||||||
CustomID option.NullableString `json:"custom_id,omitempty"`
|
CustomID option.NullableString `json:"custom_id,omitempty"`
|
||||||
|
@ -95,13 +95,37 @@ func (d InteractionResponseData) WriteMultipart(body *multipart.Writer) error {
|
||||||
return sendpart.Write(body, d, d.Files)
|
return sendpart.Write(body, d, d.Files)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AutocompleteChoice is the choice in ApplicationCommandAutocompleteResult in
|
// AutocompleteChoices are the choices to send back to Discord when sending a
|
||||||
// the official documentation.
|
// ApplicationCommandAutocompleteResult interaction response.
|
||||||
type AutocompleteChoice struct {
|
//
|
||||||
Name string `json:"name"`
|
// The following types implement this interface:
|
||||||
Value string `json:"value"`
|
//
|
||||||
|
// - AutocompleteStringChoices
|
||||||
|
// - AutocompleteIntegerChoices
|
||||||
|
// - AutocompleteNumberChoices
|
||||||
|
//
|
||||||
|
type AutocompleteChoices interface {
|
||||||
|
choices()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AutocompleteStringChoices are string choices to send back to Discord as
|
||||||
|
// autocomplete results.
|
||||||
|
type AutocompleteStringChoices []discord.StringChoice
|
||||||
|
|
||||||
|
func (c AutocompleteStringChoices) choices() {}
|
||||||
|
|
||||||
|
// AutocompleteIntegerChoices are integer choices to send back to Discord as
|
||||||
|
// autocomplete results.
|
||||||
|
type AutocompleteIntegerChoices []discord.IntegerChoice
|
||||||
|
|
||||||
|
func (c AutocompleteIntegerChoices) choices() {}
|
||||||
|
|
||||||
|
// AutocompleteNumberChoices are number choices to send back to Discord as
|
||||||
|
// autocomplete results.
|
||||||
|
type AutocompleteNumberChoices []discord.NumberChoice
|
||||||
|
|
||||||
|
func (c AutocompleteNumberChoices) choices() {}
|
||||||
|
|
||||||
// RespondInteraction responds to an incoming interaction. It is also known as
|
// RespondInteraction responds to an incoming interaction. It is also known as
|
||||||
// an "interaction callback".
|
// an "interaction callback".
|
||||||
func (c *Client) RespondInteraction(
|
func (c *Client) RespondInteraction(
|
||||||
|
|
Loading…
Reference in a new issue