command

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands []Command

Functions

func AddCommand added in v0.4.0

func AddCommand(cmd Command)

AddCommand add target application command handler

func AddCommands added in v0.4.0

func AddCommands(cmds ...Command)

AddCommands add many application command handlers

func AddData added in v0.4.0

func AddData(session *discordgo.Session) error

AddData add all application commands data

func DropCommand added in v0.4.0

func DropCommand(cmd Command)

DropCommand delete target application command handler

func DropData added in v0.4.0

func DropData(session *discordgo.Session) error

DropData delete all application commands data

func DropDataManual added in v0.4.0

func DropDataManual(session *discordgo.Session, command Command) error

DropDataManual delete target application command data

func GetCommandData

func GetCommandData(name string) *discordgo.ApplicationCommand

GetCommandData getting target command data

func Handler added in v1.0.0

func Handler(session *discordgo.Session, event *discordgo.InteractionCreate)

func IsCommandNil added in v1.0.0

func IsCommandNil() bool

IsCommandNil checking Commands array is nil

func QueryCommandList

func QueryCommandList() []*discordgo.ApplicationCommandOptionChoice

QueryCommandList getting all command list

Types

type Command

type Command struct {
	Data    *discordgo.ApplicationCommand
	Usage   string
	Execute func(session *discordgo.Session, event *discordgo.InteractionCreate) error
}

type GuildCommand added in v1.3.1

type GuildCommand struct {
	Commands []Command
	GuildId  string
}

func (*GuildCommand) AddGuildData added in v1.3.1

func (g *GuildCommand) AddGuildData(session *discordgo.Session) error

AddGuildData add target guild application commands data

func (*GuildCommand) BuildHandler added in v1.3.1

func (g *GuildCommand) BuildHandler(session *discordgo.Session)

Build create guild command handler

func (*GuildCommand) DropGuildData added in v1.3.1

func (g *GuildCommand) DropGuildData(session *discordgo.Session) error

DropGuildData delete target guild application commands data

Jump to

Keyboard shortcuts

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