command

package
v0.0.0-...-c3d50c6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Example

type Example struct {
	Command  string
	HelpText string

	/* Optional rate-limiting settings */
	RateLimitMax int
	RateLimitDB  *cache.Cache

	/* Anything that needs passed to a given command can be added here */
	Logger *log.Logs // For example, the Logger
}

Example is a command

func (Example) Handle

func (c Example) Handle(ctx *multiplexer.Context)

Handle is called by the multiplexer whenever a user triggers the command.

func (Example) HandleHelp

func (c Example) HandleHelp(ctx *multiplexer.Context)

HandleHelp is not called by the multiplexer. It is used by the `!help` command (if included) to provide a bigger description of the command's functionality.

func (Example) Init

func (c Example) Init(m *multiplexer.Mux)

Init is called by the multiplexer before the bot starts to initialize any variables the command needs.

func (Example) Settings

func (c Example) Settings() *multiplexer.CommandSettings

Settings is called by the multiplexer on startup to process any settings associated with that command.

type Gatekeeper

type Gatekeeper struct {
	Command  string
	HelpText string

	Logger *log.Logs
}

Gatekeeper is a bot command

func (Gatekeeper) Handle

func (c Gatekeeper) Handle(ctx *multiplexer.Context)

Handle is called by the multiplexer whenever a user triggers the command.

func (Gatekeeper) HandleHelp

func (c Gatekeeper) HandleHelp(ctx *multiplexer.Context)

HandleHelp is called by whatever help command is in place when a user enters "!help [command name]". If the help command is not being handled, return false.

func (Gatekeeper) Init

func (c Gatekeeper) Init(m *multiplexer.Mux)

Init is called by the multiplexer before the bot starts to initialize any variables the command needs.

func (Gatekeeper) Settings

func (c Gatekeeper) Settings() *multiplexer.CommandSettings

Settings is called by the multiplexer on startup to process any settings associated with that command.

type Help

type Help struct {
	Command  string
	HelpText string

	Logger *log.Logs
}

Help is a bot command

func (Help) Handle

func (c Help) Handle(ctx *multiplexer.Context)

Handle is called by the multiplexer whenever a user triggers the command.

func (Help) HandleHelp

func (c Help) HandleHelp(ctx *multiplexer.Context)

HandleHelp is called by whatever help command is in place when a user enters "!help [command name]". If the help command is not being handled, return false.

func (Help) Init

func (c Help) Init(m *multiplexer.Mux)

Init is called by the multiplexer before the bot starts to initialize any variables the command needs.

func (Help) Settings

func (c Help) Settings() *multiplexer.CommandSettings

Settings is called by the multiplexer on startup to process any settings associated with that command.

type JPEG

type JPEG struct {
	Command  string
	HelpText string

	Logger *log.Logs
}

JPEG is a bot command

func (JPEG) Handle

func (c JPEG) Handle(ctx *multiplexer.Context)

Handle is called by the multiplexer whenever a user triggers the command.

func (JPEG) HandleHelp

func (c JPEG) HandleHelp(ctx *multiplexer.Context)

HandleHelp is called by whatever help command is in place when a user enters "!help [command name]". If the help command is not being handled, return false.

func (JPEG) Init

func (c JPEG) Init(m *multiplexer.Mux)

Init is called by the multiplexer before the bot starts to initialize any variables the command needs.

func (JPEG) Settings

func (c JPEG) Settings() *multiplexer.CommandSettings

Settings is called by the multiplexer on startup to process any settings associated with that command.

Jump to

Keyboard shortcuts

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