speedycmds

package module
v0.1.2 Latest Latest
Warning

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

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

README

speedycmds

A discordgo command library with customization allowing for custom handlers listeners and command maps.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicHandler

type BasicHandler struct {
	// Regex is true if the bot should check for the arguments using regex or the strings package.
	Regex bool
	// Prefix is the bot prefix.
	Prefix string
	// contains filtered or unexported fields
}

BasicHandler is a basic handler with support for one prefix. You can change it up how you want because of the Handler interface.

func NewBasicHandler

func NewBasicHandler(session *discordgo.Session, regex bool, prefix string, commands *command.Map) *BasicHandler

NewBasicHandler initializes a new basic handler and returns it.

func (*BasicHandler) Commands

func (h *BasicHandler) Commands() *command.Map

Commands returns the command map.

func (*BasicHandler) Handle

Handle handles a message. It is given the session and message creation information.

type Handler

type Handler interface {
	// Handle handles a message. It is given the session and message creation information.
	Handle(session *discordgo.Session, message *discordgo.MessageCreate)
	// Commands returns the command map.
	Commands() *command.Map
}

Handler is an abstract version of a handler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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