msghandler

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoResponse = errors.New("no response")

ErrNoResponse is the error a command handler should return if the bot should not produce a response

View Source
var ErrUnauthorized = errors.New("unauthorized")

ErrUnauthorized is the error a command handler should return if the user does not have permission to perform the requested action

Functions

func HasAdminRole added in v0.11.0

func HasAdminRole(logger logging.Logger, msg cmdhandler.Message, adminRole string, session *etfapi.Session) bool

HasAdminRole determines if the message author is an authorized bot admin (not super-admin)

func IsAdminAuthorized added in v0.11.0

func IsAdminAuthorized(logger logging.Logger, msg cmdhandler.Message, adminRole string, session *etfapi.Session) bool

IsAdminAuthorized determines if a user can take admin actions with the bot (ignoring channel)

func IsAdminChannel added in v0.11.0

func IsAdminChannel(logger logging.Logger, msg cmdhandler.Message, adminChannel string, session *etfapi.Session) bool

IsAdminChannel determines if a message is occurring in the admin channel for a guild

func IsSignupChannel added in v0.11.0

func IsSignupChannel(msg cmdhandler.Message, signupChannel string, session *etfapi.Session) bool

IsSignupChannel determines if a message is occurring in the designated signup channel for a guild

Types

type Handlers

type Handlers interface {
	ConnectToBot(bot.DiscordBot)
}

Handlers is the interface for a Handlers dependency that registers itself with a discrord bot

func NewHandlers

func NewHandlers(deps dependencies, opts Options) Handlers

NewHandlers creates a new Handlers object

type Options

type Options struct {
	DefaultCommandIndicator string
	SuccessColor            int
	ErrorColor              int
}

Options provides a way to pass configuration to NewHandlers

Jump to

Keyboard shortcuts

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