commandprocessor

package
v0.0.0-...-694d7ce Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = map[string]*Command{}

Commands defines all of the commands.

View Source
var DefaultPrefix = os.Getenv("DEFAULT_PREFIX")

DefaultPrefix defines the default prefix which the bot uses.

Functions

func Processor

func Processor(Message *discordgo.Message, Channel *discordgo.Channel, Session *discordgo.Session, StartTime *time.Time)

Processor is used to process messages.

Types

type Command

type Command struct {
	Description      string                                 `json:"description"`
	Usage            string                                 `json:"usage"`
	Category         *categories.Category                   `json:"category"`
	PermissionsCheck func(Args *CommandArgs) (bool, string) `json:"-"`
	Function         func(Args *CommandArgs)                `json:"-"`
}

Command is the structure which all commands will follow.

type CommandArgs

type CommandArgs struct {
	RawArgs   string
	Prefix    string
	Message   *discordgo.Message
	Channel   *discordgo.Channel
	Session   *discordgo.Session
	StartTime *time.Time
	Shared    *map[string]interface{}
}

CommandArgs are the arguments given to commands.

Jump to

Keyboard shortcuts

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