Documentation ¶
Index ¶
- Variables
- func LoadPlugin(pluginPath string) common.Module
- func LoadPlugins(directory string) []common.Module
- type Bot
- type ComponentLoader
- func (loader *ComponentLoader) CreateEvent(event common.Event) error
- func (loader *ComponentLoader) GetConfigPath(fileName string) string
- func (loader *ComponentLoader) LoadComponent(component common.Module)
- func (loader *ComponentLoader) Notify(message string) error
- func (loader *ComponentLoader) OnEventComplete(handler func(common.Event) error) error
- func (loader *ComponentLoader) OnEventCreate(handler func(common.Event) error) error
- func (loader *ComponentLoader) OnEventDelete(handler func(common.Event) error) error
- func (loader *ComponentLoader) OnEventUpdate(handler func(common.Event) error) error
- func (loader *ComponentLoader) OnNotify(handler func(string) error) error
- func (loader *ComponentLoader) OnReady(handler func() error) error
- func (loader *ComponentLoader) RegisterCommand(name string, config common.ChatCommandConfiguration, ...)
- func (loader *ComponentLoader) RegisterExternalChat(ID string, chat common.ExternalChatModule) error
- type ExternalChatManager
Constants ¶
This section is empty.
Variables ¶
View Source
var Build string
View Source
var Version string
Functions ¶
func LoadPlugin ¶ added in v0.3.0
LoadPlugin loads a plugin and returns its component if successful
func LoadPlugins ¶ added in v0.3.0
LoadPlugins loads all plugins and componenets in a directory
Types ¶
type Bot ¶
type Bot struct { Session *discord.Discord Mastodon *mastodon.Mastodon Database persistence.Database // contains filtered or unexported fields }
func (*Bot) InitalizeExternalChat ¶ added in v0.4.2
func (app *Bot) InitalizeExternalChat(channel *core.Channel, chat common.ExternalChatModule)
func (*Bot) Initialize ¶
Initalize creates the discord session and registers handlers
type ComponentLoader ¶ added in v0.3.0
type ComponentLoader struct {
// contains filtered or unexported fields
}
func NewComponentLoader ¶ added in v0.3.0
func NewComponentLoader(bot *Bot, configDir string) *ComponentLoader
func (*ComponentLoader) CreateEvent ¶ added in v0.3.0
func (loader *ComponentLoader) CreateEvent(event common.Event) error
func (*ComponentLoader) GetConfigPath ¶ added in v0.4.2
func (loader *ComponentLoader) GetConfigPath(fileName string) string
func (*ComponentLoader) LoadComponent ¶ added in v0.3.0
func (loader *ComponentLoader) LoadComponent(component common.Module)
func (*ComponentLoader) Notify ¶ added in v0.3.0
func (loader *ComponentLoader) Notify(message string) error
func (*ComponentLoader) OnEventComplete ¶ added in v0.3.0
func (loader *ComponentLoader) OnEventComplete(handler func(common.Event) error) error
func (*ComponentLoader) OnEventCreate ¶ added in v0.3.0
func (loader *ComponentLoader) OnEventCreate(handler func(common.Event) error) error
func (*ComponentLoader) OnEventDelete ¶ added in v0.3.0
func (loader *ComponentLoader) OnEventDelete(handler func(common.Event) error) error
func (*ComponentLoader) OnEventUpdate ¶ added in v0.3.0
func (loader *ComponentLoader) OnEventUpdate(handler func(common.Event) error) error
func (*ComponentLoader) OnNotify ¶ added in v0.3.0
func (loader *ComponentLoader) OnNotify(handler func(string) error) error
func (*ComponentLoader) OnReady ¶ added in v0.3.0
func (loader *ComponentLoader) OnReady(handler func() error) error
func (*ComponentLoader) RegisterCommand ¶ added in v0.4.2
func (loader *ComponentLoader) RegisterCommand(name string, config common.ChatCommandConfiguration, handler func(common.User, map[string]any) string)
func (*ComponentLoader) RegisterExternalChat ¶ added in v0.4.2
func (loader *ComponentLoader) RegisterExternalChat(ID string, chat common.ExternalChatModule) error
type ExternalChatManager ¶ added in v0.4.2
type ExternalChatManager struct {
// contains filtered or unexported fields
}
func (*ExternalChatManager) SendMessage ¶ added in v0.4.2
func (manager *ExternalChatManager) SendMessage(user string, message string)
Click to show internal directories.
Click to hide internal directories.