SpeedyCmds

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 5 Imported by: 0

README

SpeedyCmds

A DiscordGo Command Lib with customizability allowing for custom handlers listeners and command maps.

Documentation

Overview

A package for command routing with discordgo

Index

Constants

This section is empty.

Variables

View Source
var CommandRegex = regexp.MustCompile(`(?m)("[^"]+"|[^\s"]+)`)

Functions

func Shift

func Shift(a []string, i int) ([]string, string)

Types

type Handler

type Handler interface {
	Handle(s *discordgo.Session, msg *discordgo.MessageCreate)
	//Returns a *commandmap.Map in use for this Handler
	GetCommandMap() *commandMap.Map
}

type PremadeHandler

type PremadeHandler struct {

	//states wether to use a regex match or a simple split
	Regex  bool
	Prefix string
	// contains filtered or unexported fields
}

this is the basic premade handler with support for one prefix u can change it up how u want because of the whole interfaces

func New

func New(dg *discordgo.Session, cmds *commandMap.Map, Regex bool, prefix string) *PremadeHandler

initializes a basic pre made handler for you. noinspection ALL

func (*PremadeHandler) GetCommandMap added in v0.0.8

func (h *PremadeHandler) GetCommandMap() *commandMap.Map

Directories

Path Synopsis
ctx

Jump to

Keyboard shortcuts

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