Channel type restriction (#1015)

This commit is contained in:
Fedor Lapshin 2021-10-10 17:59:59 +03:00 committed by GitHub
parent 842ddb357a
commit 4249df2359
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -76,6 +76,11 @@ var (
Type: discordgo.ApplicationCommandOptionChannel, Type: discordgo.ApplicationCommandOptionChannel,
Name: "channel-option", Name: "channel-option",
Description: "Channel option", Description: "Channel option",
// Channel type mask
ChannelTypes: []discordgo.ChannelType{
discordgo.ChannelTypeGuildText,
discordgo.ChannelTypeGuildVoice,
},
Required: false, Required: false,
}, },
{ {

View file

@ -92,6 +92,7 @@ type ApplicationCommandOption struct {
Required bool `json:"required"` Required bool `json:"required"`
Choices []*ApplicationCommandOptionChoice `json:"choices"` Choices []*ApplicationCommandOptionChoice `json:"choices"`
Options []*ApplicationCommandOption `json:"options"` Options []*ApplicationCommandOption `json:"options"`
ChannelTypes []ChannelType `json:"channel_types"`
} }
// ApplicationCommandOptionChoice represents a slash command option choice. // ApplicationCommandOptionChoice represents a slash command option choice.