Documentation
¶
Index ¶
- Variables
- func HasAdminRole(ctx context.Context, logger Logger, sess *session.Session, msg MessageLike, ...) bool
- func IsAdminAuthorized(ctx context.Context, logger Logger, msg MessageLike, adminRoles []string, ...) bool
- func IsAdminChannel(logger Logger, msg MessageLike, adminChannel string, sess *session.Session) bool
- func IsSignupChannel(msg MessageLike, signupChannel string, sess *session.Session) bool
- type Handlers
- type Logger
- type MessageLike
- 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(ctx context.Context, logger Logger, sess *session.Session, msg MessageLike, adminRoles []string, b *bot.DiscordBot) bool
HasAdminRole determines if the message author is an authorized bot admin (not super-admin)
func IsAdminAuthorized ¶ added in v0.11.0
func IsAdminAuthorized(ctx context.Context, logger Logger, msg MessageLike, adminRoles []string, sess *session.Session, b *bot.DiscordBot) 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 Logger, msg MessageLike, adminChannel string, sess *session.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 MessageLike, signupChannel string, sess *session.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 ¶
NewHandlers creates a new Handlers object