discom

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 5 Imported by: 3

README

discom

A basic command handler for discordgo refer to the main/main.go

What is this?

This is just a bare bones lib to make it easier to add commands and update the help command for a discord bot, It also means you don't need to remember to add the handler.

How to use this?

Refer to main/main.go or my chessbot

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Re          *regexp.Regexp
	Handler     CommandHandler
	Description string
	Example     string
	CaseSense   bool
}

Command Command

type CommandHandler

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

CommandHandler CommandHandler

type CommandSet

type CommandSet struct {
	PrefixRe *regexp.Regexp
	// contains filtered or unexported fields
}

CommandSet CommandSet

func CreateCommandSet

func CreateCommandSet(prefixRe *regexp.Regexp) *CommandSet

CreateCommandSet CreateCommandSet

func (*CommandSet) AddCommand

func (cs *CommandSet) AddCommand(com Command) error

AddCommand AddCommand

func (*CommandSet) Handler

func (cs *CommandSet) Handler(s *discordgo.Session, m *discordgo.MessageCreate)

Handler Handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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