Documentation
¶
Index ¶
Constants ¶
View Source
const (
CommandKeyword = "!"
)
Variables ¶
View Source
var SlashCommands = []*discordgo.ApplicationCommand{ { Name: "top", Description: "Leaderboard", }, { Name: "score", Description: "Show your score", }, { Name: "roll", Description: "Generate a random number", Options: []*discordgo.ApplicationCommandOption{ { Type: discordgo.ApplicationCommandOptionInteger, Name: "max", Description: "Will generate a random number between 1 and 'max'. Default: 100", Required: false, }, { Type: discordgo.ApplicationCommandOptionInteger, Name: "quantity", Description: "How many times. Default: 1", Required: false, }, }, }, { Name: "duel", Description: "make roll against opponent", Options: []*discordgo.ApplicationCommandOption{ { Type: discordgo.ApplicationCommandOptionUser, Name: "opponent", Description: "opponent", Required: true, }, { Type: discordgo.ApplicationCommandOptionInteger, Name: "bet", Description: "bet", Required: true, }, }, }, { Name: "bet", Description: "Make a bet", Options: []*discordgo.ApplicationCommandOption{ { Type: discordgo.ApplicationCommandOptionInteger, Name: "bet", Description: "bet", Required: true, }, }, }, { Name: "city", Description: "guess the city", Options: []*discordgo.ApplicationCommandOption{ { Type: discordgo.ApplicationCommandOptionString, Name: "city", Description: "city", Required: true, }, }, }, }
SlashCommands list of slash commands for registration on Discord
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(r repository.Repository, e chan string, cfg *config.Config, loc *i18n.Localizer) *Handler
func (*Handler) HandleInteraction ¶
func (h *Handler) HandleInteraction(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleInteraction slash commands handler
func (*Handler) HandleMessage ¶
func (h *Handler) HandleMessage(s *discordgo.Session, m *discordgo.MessageCreate)
HandleMessage text command handler
Click to show internal directories.
Click to hide internal directories.