framework

package
v0.0.0-...-0cb3190 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdMap

type CmdMap map[string]Command

type Command

type Command struct {
	Name        string
	Description string
	Usage       string
	Run         func(ctx Context)
	Validator   func(ctx Context) bool
	GuildOny    bool
}

type CommandHandler

type CommandHandler struct {
	Command CmdMap
	MS      *MongoSession
}

func NewCommandHandler

func NewCommandHandler() *CommandHandler

func NewCommandHandlerWithDB

func NewCommandHandlerWithDB(db, collection string) *CommandHandler

func (CommandHandler) AddCommand

func (ch CommandHandler) AddCommand(c Command)

func (CommandHandler) OnMessage

func (ch CommandHandler) OnMessage(message string, s *discordgo.Session, m *discordgo.MessageCreate)

type Context

type Context struct {
	S    *discordgo.Session
	M    *discordgo.MessageCreate
	Args []string
	MS   *MongoSession
}

func (Context) Send

func (ctx Context) Send(message string)

type MongoSession

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

func InitDB

func InitDB(db, collection string) (*MongoSession, error)

func (MongoSession) CreateGuildConfig

func (ms MongoSession) CreateGuildConfig(guildID string) error

func (MongoSession) GetDisabledCommands

func (ms MongoSession) GetDisabledCommands(guildID string) ([]string, error)

func (MongoSession) GetPrefix

func (ms MongoSession) GetPrefix(guildID string) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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