cmds

package
v0.0.0-...-11ecc79 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCoins

func GetCoins(ds *discordgo.Session, dm *discordgo.Message, content []string)

GetCoins returns the level of the current user or first mentioned user

func GetLevel

func GetLevel(ds *discordgo.Session, dm *discordgo.Message, content []string)

GetLevel answers with the first mentioned user or the author

func GetXP

func GetXP(ds *discordgo.Session, dm *discordgo.Message, content []string)

func Ping

func Ping(ds *discordgo.Session, dm *discordgo.Message, content []string)

Types

type Command

type Command struct {
	ID  int
	Cmd string
	Run HandlerFunc
}

type Commands

type Commands struct {
	Routes []*Command
	Prefix string
}

func New

func New() *Commands

create route

func (*Commands) OnMessage

func (c *Commands) OnMessage(s *discordgo.Session, mc *discordgo.MessageCreate)

func (*Commands) OnMessageC

func (c *Commands) OnMessageC(s *discordgo.Session, mc *discordgo.MessageCreate)

messages -> commands

func (*Commands) RegisterCommand

func (c *Commands) RegisterCommand(cmd string, f HandlerFunc, id int) (*Command, error)

register commands

type HandlerFunc

type HandlerFunc func(*discordgo.Session, *discordgo.Message, []string)

handler signature

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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