dgo

package module
v0.0.0-...-36fb7f6 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

dgotemplate

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCommandEmpty = errors.New("command is empty")
)

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Handler     MessageHandler
	Usage       string
	Description string
}

type Helper

type Helper struct {
	Session *discordgo.Session

	DefaultHandler MessageHandler
	// contains filtered or unexported fields
}

func New

func New(prefix string, botToken string) (h *Helper, err error)

func NewHelperFromSession

func NewHelperFromSession(prefix string, s *discordgo.Session) (h *Helper)

func (*Helper) AddHandler

func (h *Helper) AddHandler(command string, handler *Handler) func()

func (*Helper) AddHandlerMultipleCommands

func (h *Helper) AddHandlerMultipleCommands(commands []string, handler *Handler) map[string]func()

func (*Helper) AddHandlers

func (h *Helper) AddHandlers(handlers map[string]*Handler) map[string]func()

func (*Helper) AddHandlersMultipleCommands

func (h *Helper) AddHandlersMultipleCommands(commands []struct {
	Commands []string
	Handler  *Handler
}) map[string]func()

func (*Helper) CmdArgs

func (h *Helper) CmdArgs(m *discordgo.MessageCreate) (cmd string, argc int, argv []string)

func (*Helper) Open

func (h *Helper) Open() error

func (*Helper) SetPrefix

func (h *Helper) SetPrefix(prefix string)

type MessageHandler

type MessageHandler func(*discordgo.Session, *discordgo.MessageCreate)

Jump to

Keyboard shortcuts

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