mux

package
v0.0.0-...-83732ad Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func About

func About(s *discordgo.Session, dm *discordgo.Message)

func Help

func Help(s *discordgo.Session, dm *discordgo.Message)

Types

type Command

type Command struct {
	Name string
	Run  CommandRoutine
	Help string
}

type CommandCollection

type CommandCollection struct {
	Commands []*Command
	Flag     Permissions
}

type CommandRoutine

type CommandRoutine func(s *discordgo.Session, dm *discordgo.Message)

type Context

type Context struct {
	// contains filtered or unexported fields
}

type Mux

type Mux struct {
	Collection CommandCollection
	Pattern    string
}

func NewMux

func NewMux(pattern string) *Mux

func (*Mux) MessageCreate

func (m *Mux) MessageCreate(ds *discordgo.Session, mc *discordgo.MessageCreate)

func (*Mux) PermissionChecker

func (m *Mux) PermissionChecker(userPerm []string, channelID string) bool

func (*Mux) RegisterCommand

func (m *Mux) RegisterCommand(name, help string, cmd CommandRoutine, perm Permissions)

func (*Mux) SearchForCommand

func (m *Mux) SearchForCommand(msg string, userPerm []string, channelID string) *Command

type Permissions

type Permissions struct {
	User    []string
	Channel []string
}

Jump to

Keyboard shortcuts

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