handlers

package
v0.0.0-...-518a455 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommand

func AddCommand(command string, handler CommandHandler)

AddCommand registers a new command for the command handler

Types

type CommandHandler

type CommandHandler = func(discord *discordgo.Session, cmd *InvokedCommand)

CommandHandler describes what a command handler function should look like

type InvokedCommand

type InvokedCommand struct {
	Session *discordgo.Session
	Guild   *discordgo.Guild
	Channel *discordgo.Channel
	Message *discordgo.Message
	Member  *discordgo.Member
	User    *discordgo.User

	DBGuild *gophbot.Guild

	Args []string
}

InvokedCommand is a convenience struct that holds all the collected information before invoking a command.

func (*InvokedCommand) HasPermission

func (c *InvokedCommand) HasPermission(permission int) bool

HasPermission is a convenience command that allows for quick & simple permission checking.

func (*InvokedCommand) Reply

func (c *InvokedCommand) Reply(reply string) (msg *discordgo.Message, err error)

Reply is a convenience method that allows for quick replies to a command.

Jump to

Keyboard shortcuts

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