Documentation
¶
Index ¶
- Variables
- func HasAdminRole(logger logging.Logger, msg cmdhandler.Message, adminRole string, ...) bool
- func IsAdminAuthorized(logger logging.Logger, msg cmdhandler.Message, adminRole string, ...) bool
- func IsAdminChannel(logger logging.Logger, msg cmdhandler.Message, adminChannel string, ...) bool
- func IsSignupChannel(msg cmdhandler.Message, signupChannel string, session *etfapi.Session) bool
- type Handlers
- type Options
Constants ¶
This section is empty.
Variables ¶
var ErrNoResponse = errors.New("no response")
ErrNoResponse is the error a command handler should return if the bot should not produce a response
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
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 ¶
NewHandlers creates a new Handlers object