mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-05 19:57:02 +00:00
discord: Add Autocomplete flag to some options (#311)
* Add Autocomplete flags to Number and Integer options * Add autocomplete warning for choices
This commit is contained in:
parent
d6bc738e50
commit
c5f8fff98f
|
@ -363,11 +363,12 @@ type CommandOptionValue interface {
|
|||
|
||||
// StringOption is a subcommand option that fits into a CommandOptionValue.
|
||||
type StringOption struct {
|
||||
OptionName string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Required bool `json:"required"`
|
||||
Choices []StringChoice `json:"choices,omitempty"`
|
||||
Autocomplete bool `json:"autocomplete"`
|
||||
OptionName string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Required bool `json:"required"`
|
||||
Choices []StringChoice `json:"choices,omitempty"`
|
||||
// Autocomplete must not be true if Choices are present.
|
||||
Autocomplete bool `json:"autocomplete"`
|
||||
}
|
||||
|
||||
// Name implements CommandOption.
|
||||
|
@ -391,6 +392,8 @@ type IntegerOption struct {
|
|||
Min option.Int `json:"min_value,omitempty"`
|
||||
Max option.Int `json:"max_value,omitempty"`
|
||||
Choices []IntegerChoice `json:"choices,omitempty"`
|
||||
// Autocomplete must not be true if Choices are present.
|
||||
Autocomplete bool `json:"autocomplete"`
|
||||
}
|
||||
|
||||
// Name implements CommandOption.
|
||||
|
@ -485,6 +488,8 @@ type NumberOption struct {
|
|||
Min option.Float `json:"min_value,omitempty"`
|
||||
Max option.Float `json:"max_value,omitempty"`
|
||||
Choices []NumberChoice `json:"choices,omitempty"`
|
||||
// Autocomplete must not be true if Choices are present.
|
||||
Autocomplete bool `json:"autocomplete"`
|
||||
}
|
||||
|
||||
// Name implements CommandOption.
|
||||
|
|
Loading…
Reference in a new issue