commands

package
v0.0.0-...-f0c0f71 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommandCollection = make(plugins.Collection[*WafferCommand])

Functions

func Add

func Add(cmd *WafferCommand) error

func AddList

func AddList(commands ...*WafferCommand)

Types

type CommandData

type CommandData struct {
	// Name of the command.
	Name string
	// Command description
	Description string
	// Command arguments
	Arguments []string
	// Required arguments
	RequiredArgs uint
	// Command category
	Category string
	// Command permissions
	Permissions *CommandPermissions
	// Application command
	Slash *discordgo.ApplicationCommand
}

CommandData is a struct that contains some usefull information for a command.

type CommandPermissions

type CommandPermissions struct {
	AllowDM   bool
	OwnerOnly bool
	Require   discordgo.PermissionOverwriteType
}

type WafferCommand

type WafferCommand struct {
	Plugin *plugins.Plugin[*discordgo.MessageCreate]
	// If the plugin is a command sets some usefull information.
	Data *CommandData
}

func Get

func Get(name string) (*WafferCommand, error)

Get returns a command from the CommandCollection if it exists.

func (*WafferCommand) HelpEmbed

func (cmd *WafferCommand) HelpEmbed() (*discordgo.MessageEmbed, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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