commands

package
v0.0.0-...-2726414 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 11 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL