command

package
v0.0.0-...-3e389c1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 4 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.

Jump to

Keyboard shortcuts

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