Documentation ¶
Index ¶
- Constants
- Variables
- func Connect(token string) *discordgo.Session
- func RegisterCommands(session *discordgo.Session, commands map[string]*Command, guildID types.ID)
- func UnregisterCommands(session *discordgo.Session, commands map[string]*Command, guildID types.ID)
- type Command
- type Config
- type Handler
- type Probe
Constants ¶
View Source
const ( CastName = "cast" CastOptionChannel = "channel" )
View Source
const ( LockName = "lock" LockOptionLimit = "limit" )
View Source
const ( QuoteName = "quote" QuoteOptionAuthor = "author" QuoteOptionText = "text" )
View Source
const ( RollName = "roll" RollOptionSize = "size" RollOptionCount = "count" )
View Source
const ( RollOptionSizeDefault = die.D100 RollOptionCountDefault = 1 )
View Source
const (
UnlockName = "unlock"
)
Variables ¶
View Source
var Cast = &discordgo.ApplicationCommand{ Name: CastName, Description: "Mention all users in a voice channel", Options: []*discordgo.ApplicationCommandOption{ { Name: CastOptionChannel, Description: "Channel to mention", Type: discordgo.ApplicationCommandOptionChannel, ChannelTypes: []discordgo.ChannelType{ discordgo.ChannelTypeGuildVoice, }, }, }, }
View Source
var Lock = &discordgo.ApplicationCommand{ Name: LockName, Description: "Set user limit for current voice channel", Options: []*discordgo.ApplicationCommandOption{ { Name: LockOptionLimit, Description: "Custom limit value", Type: discordgo.ApplicationCommandOptionInteger, MinValue: &lockOptionLimitMinValue, MaxValue: lockOptionLimitMaxValue, }, }, }
View Source
var Quote = &discordgo.ApplicationCommand{ Name: QuoteName, Description: "Manage the most stunning quotes of the specified user", Options: []*discordgo.ApplicationCommandOption{ { Name: QuoteOptionAuthor, Description: "The user who said that", Type: discordgo.ApplicationCommandOptionUser, Required: true, }, { Name: QuoteOptionText, Description: "The text of the quote", Type: discordgo.ApplicationCommandOptionString, }, }, }
View Source
var Roll = buildRoll()
View Source
var Unlock = &discordgo.ApplicationCommand{ Name: UnlockName, Description: "Remove user limit for current voice channel", }
Functions ¶
func RegisterCommands ¶
Types ¶
type Command ¶
type Command struct { Description *discordgo.ApplicationCommand Handler Handler }
type Handler ¶
type Handler interface {
Handle(i *discordgo.InteractionCreate)
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.