command

package
v0.0.0-...-26efd1a Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseCommand

type BaseCommand struct {
	Active bool
	Name   string
	Help   string
}

func NewBaseCommand

func NewBaseCommand(name, help string, active bool) *BaseCommand

NewBaseCommand creates a new bot base command instance.

type Command

type Command struct {
	Prefix   string
	Bot      *bot.Bot
	Commands map[string]ICommand
}

func New

func New(prefix string, bot *bot.Bot) (*Command, error)

New creates a new bot command instance.

func (*Command) Load

func (c *Command) Load(commands ...ICommand)

Load loads the given bot commands.

func (*Command) Process

Process handles the command execution.

type ICommand

type ICommand interface {
	Active() bool
	Name() string
	Help() string
	Execute(bot *bot.Bot, m *Message) error
}

type Message

type Message struct {
	*discordgo.MessageCreate
	Args []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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