commands

package
v0.8.20 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const GlobalCommandGuildID = "-1"

Variables

View Source
var (
	CommandsFactories = map[string]CommandFactory{}
	Commands          = map[string]*discordgo.ApplicationCommand{}
	CommandHandlers   = map[string]CommandHandler{}
)

Functions

func GetDuplicateCommands added in v0.8.20

func GetDuplicateCommands(in []*discordgo.ApplicationCommand) []*discordgo.ApplicationCommand

Types

type Cmds

type Cmds struct {
	// contains filtered or unexported fields
}

func New

func New(logger *zap.Logger, s *discordgo.Session, cfg *config.Config) (*Cmds, error)

func (*Cmds) RegisterGlobalCommands added in v0.8.20

func (c *Cmds) RegisterGlobalCommands() error

func (*Cmds) RemoveGuildCommands added in v0.8.20

func (c *Cmds) RemoveGuildCommands(guildID string) error

type CommandFactory added in v0.8.20

type CommandFactory = func(cfg *config.Config) (*discordgo.ApplicationCommand, CommandHandler, error)

type CommandHandler added in v0.8.20

type CommandHandler = func(s *discordgo.Session, i *discordgo.InteractionCreate)

func NewFivenetCommand added in v0.8.20

func NewFivenetCommand(cfg *config.Config) (*discordgo.ApplicationCommand, CommandHandler, error)

func NewHandleFivenetCommand added in v0.8.20

func NewHandleFivenetCommand(url string) CommandHandler

Jump to

Keyboard shortcuts

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