Versions in this module Expand all Collapse all v2 v2.5.0 Nov 24, 2021 Changes in this version + const EventCommanderClose + const MaxDepth + var DefaultLoaderChain = []LoaderFactory + func ArgsSplitter(in string) []string + type CCConfig struct + AutoJoinChannels map[PlatformType][]interface{} + AutoloadPlugins bool + OtherConfig map[string]interface{} + Platforms []Platform + PluginLoaders []LoaderFactory + Prefix string + Tokens map[PlatformType]string + type Command struct + Handler CommandHandler + Info *PJCommand + Subcommands map[string]*Command + type CommandGroupContainer struct + Commands map[string]*Command + Info *PluginJSON + type CommandHandler func(*MessageContext, []string) error + type Commander struct + GuardBeforeCommandCheck func(*MessageContext, string, []string) bool + GuardBeforeCommandExec func(*MessageContext, string, []string) bool + GuardPostCommandCheck func(*MessageContext, string, []string) + OnError func(error) + func NewCommander(config *CCConfig, ctx context.Context) (*Commander, error) + func (c *Commander) Close() + func (c *Commander) GetCommandGroups() map[string]*CommandGroupContainer + func (c *Commander) GetCommands() map[string]*Command + func (c *Commander) HandleError(f func(error)) + func (c *Commander) Help(m *MessageContext, args []string) error + func (c *Commander) JoinChannel(platform PlatformType, channel interface{}) error + func (c *Commander) LeaveChannel(platform PlatformType, channel interface{}) error + func (c *Commander) Open() error + func (c *Commander) RegisterCommand(groupName string) func(info *PJCommand, handler CommandHandler) error + func (c *Commander) SendMessage(platform PlatformType, channelID interface{}, message interface{}) (interface{}, error) + func (c *Commander) SetupPlugin(setup func(RegisterCommand, context.Context), info *PluginJSON) + func (c *Commander) SetupPluginFromConfig(setup func(ctx context.Context) (map[string]CommandHandler, error), ...) error + type GetCommandHandler func(string) (CommandHandler, error) + type GetPlugin func(string) (interface{}, error) + type Loader interface + GetCommandHandler func(string) (CommandHandler, error) + LoadPlugin func(string) error + type LoaderFactory interface + GetTypeName func() PluginType + New func(context.Context) Loader + type Message struct + Author MessageUser + RealmID string + type MessageContext struct + Context context.Context + PlatformData interface{} + func (m *MessageContext) Send(message interface{}) (interface{}, error) + func (m *MessageContext) SendTo(channelID interface{}, message interface{}) (interface{}, error) + type MessageUser struct + ID string + IsMod func() bool + IsStreamer func() bool + Username string + type NativeLoader struct + Context context.Context + func (n *NativeLoader) GetCommandHandler(name string) (CommandHandler, error) + func (n *NativeLoader) LoadPlugin(name string) error + type NewNativeLoader struct + func (n *NewNativeLoader) GetTypeName() PluginType + func (n *NewNativeLoader) New(ctx context.Context) Loader + type PJCommand struct + Activator string + HandlerName string + Help string + Name string + Subcommands []*PJCommand + SupportedPlatforms PlatformType + type Platform interface + Close func() error + GenHelp func(interface{}, *MessageContext) error + GetClient func() interface{} + GetPlatformType func() PlatformType + JoinChannel func(interface{}) error + LeaveChannel func(interface{}) error + Open func(context.Context) error + RegisterEvents func(EventBus.BusPublisher) error + RegisterMessageHandler func(func(string, *MessageContext)) error + Setup func(string) error + type PlatformType uint + const PlatformDiscord + const PlatformGlimesh + const PlatformTwitch + func (pt PlatformType) ToString() string + type PluginJSON struct + Commands []*PJCommand + Creator string + Description string + HideInHelp bool + License string + Name string + PluginType PluginType + SupportedPlatforms PlatformType + URL string + type PluginType string + const NativePluginLoader + type RegisterCommand func(*PJCommand, CommandHandler) error Other modules containing this package gitlab.com/crius-bots/criuscommander