Documentation
¶
Index ¶
- Variables
- func AllowOnCertainChannels(chanids []string) muxer.HandlerFunc
- func GetListOfPlugins() []string
- func Register(name string, plugin IPluginInitalizer)
- func StrSliceContainsStr(s string, slice []string) bool
- type Context
- func (s *Context) InitializePlugin(f IPlugin) error
- func (s *Context) InstallRoute(command, description string, middlewares ...muxer.HandlerFunc) error
- func (s *Context) ListLoadedPlugins(ctx *muxer.Context)
- func (s *Context) LoadPlugin(ctx *muxer.Context)
- func (s *Context) Start() error
- func (s *Context) Stop() error
- func (s *Context) UnloadPlugin(ctx *muxer.Context)
- type DatabaseConfig
- type IBasicPlugin
- type IPlugin
- type IPluginInitalizer
- type InstallFunc
- type PluginConfig
- type PluginConfigVars
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CurrentVersion is set by the linker and contains the Git Commit hash CurrentVersion = "" // BuildTime is set by the linker and includes the time in UTC on which the bot was compiled BuildTime = "" )
View Source
var DefaultAdminMiddleware muxer.HandlerFunc = nil
Functions ¶
func AllowOnCertainChannels ¶
func AllowOnCertainChannels(chanids []string) muxer.HandlerFunc
func GetListOfPlugins ¶
func GetListOfPlugins() []string
func Register ¶
func Register(name string, plugin IPluginInitalizer)
Register makes a plugin available to the system
func StrSliceContainsStr ¶
StrSliceContainsStr returns a boolean if s is found in slice
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context TODO
func (*Context) InitializePlugin ¶
InitializePlugin registers a plugin with the bot & router
func (*Context) InstallRoute ¶
func (s *Context) InstallRoute(command, description string, middlewares ...muxer.HandlerFunc) error
installRoute installs a new command into the bot
func (*Context) ListLoadedPlugins ¶
func (*Context) LoadPlugin ¶
func (*Context) UnloadPlugin ¶
type DatabaseConfig ¶
type DatabaseConfig struct {
Path string `json:"path"`
}
type IBasicPlugin ¶
type IBasicPlugin interface { // Name returns the name of the plugin Name() string // InstallRoute TODO InstallRoute(InstallFunc) error }
type IPlugin ¶
type IPlugin interface { Destroy() error // SupportsUnload returns a boolean if this plugin should be allowed to be !unloaded via a command SupportsUnload() bool IBasicPlugin }
IPlugin defines an interface that plugins can use to embedd into the bot process that are "long running" or maintain some level of state throughout the lifecycle of the bot
type IPluginInitalizer ¶
type IPluginInitalizer interface {
Initialize(PluginConfigVars, *discordgo.Session, storm.Node) (IPlugin, error)
}
func GetPlugin ¶
func GetPlugin(name string) IPluginInitalizer
type InstallFunc ¶
type InstallFunc func(command, description string, middlewares ...muxer.HandlerFunc) error
type PluginConfig ¶
type PluginConfig struct { PluginName string `yaml:"name" json:"name"` Enabled bool `yaml:"enabled" json:"enabled"` Config json.RawMessage `yaml:"config" json:"config"` }
type PluginConfigVars ¶
type PluginConfigVars json.RawMessage
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package muxer provides a simple Discord message route multiplexer that parses messages and then executes a matching registered handler, if found.
|
Package muxer provides a simple Discord message route multiplexer that parses messages and then executes a matching registered handler, if found. |
Click to show internal directories.
Click to hide internal directories.