commands

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelpCommand

func HelpCommand(session *discordgo.Session, message *discordgo.MessageCreate, ctx *Context) error

Types

type Command

type Command struct {
	Name      string
	ShortHelp string
	Function  CommandFunction
}

type CommandFunction

type CommandFunction func(*discordgo.Session, *discordgo.MessageCreate, *Context) error

type Commands

type Commands struct {
	Commands []*Command
	Redis    *redis.Client
}

func New

func New(r *redis.Client) *Commands

func (*Commands) GetCommand

func (com *Commands) GetCommand(msg string) (*Command, []string)

func (*Commands) OnMessageCreate

func (com *Commands) OnMessageCreate(session *discordgo.Session, message *discordgo.MessageCreate)

func (*Commands) RegisterCommand

func (com *Commands) RegisterCommand(Name, ShortHelp string, Function CommandFunction)

type Context

type Context struct {
	Args       []string
	Content    string
	ChannelID  string
	GuildID    string
	Type       discordgo.ChannelType
	HasPrefix  bool
	HasMention bool
	Commands   *Commands
}

Jump to

Keyboard shortcuts

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