Documentation ¶
Index ¶
- Variables
- func MentionMatcher(userID string) *regexp.Regexp
- func NoOpHandlerFunc(context.Context, discordclient.Message)
- func PrefixMatcher(prefix string) *regexp.Regexp
- func ReplyToMessage(listenerCtx context.Context, message interface{}) error
- func ScaffoldBot(config BotScaffolding) error
- func Tokenize(message discordclient.Message) []string
- type BotScaffolding
- type Command
- type CommandGroup
- type CommandMux
- type HandlerFunc
- type Listener
Constants ¶
This section is empty.
Variables ¶
View Source
var ListenerCtxKey ctxKey = "listener"
View Source
var MessageCtxKey ctxKey = "message"
Functions ¶
func MentionMatcher ¶
func NoOpHandlerFunc ¶
func NoOpHandlerFunc(context.Context, discordclient.Message)
NoOpHandlerFunc does no operations againdst a message. This can be an equivalent to nil.
func PrefixMatcher ¶
func ReplyToMessage ¶
ReplyToMessage will use the message context to reply to a message. Message may be one of two types: - *discordgo.MessageSend - string
func ScaffoldBot ¶
func ScaffoldBot(config BotScaffolding) error
func Tokenize ¶
func Tokenize(message discordclient.Message) []string
Types ¶
type BotScaffolding ¶
type Command ¶
type Command struct { CommandName string Handler HandlerFunc }
type CommandGroup ¶
type CommandGroup []Command
func (CommandGroup) RegisterCommands ¶
func (cg CommandGroup) RegisterCommands(commandTrie *trie.PathTrie, prefix string)
type CommandMux ¶
type CommandMux struct {
// contains filtered or unexported fields
}
func NewCommandMux ¶
func NewCommandMux(matcher *regexp.Regexp) CommandMux
func (CommandMux) Handler ¶
func (c CommandMux) Handler(ctx context.Context, message discordclient.Message)
func (CommandMux) RegisterCommandGroup ¶
func (c CommandMux) RegisterCommandGroup(prefix string, group CommandGroup)
type HandlerFunc ¶
type HandlerFunc func(context.Context, discordclient.Message)
type Listener ¶
type Listener struct { DiscordClient *discordclient.DiscordClient // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.