app

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Build string
View Source
var Version string

Functions

func LoadPlugin added in v0.3.0

func LoadPlugin(pluginPath string) common.Module

LoadPlugin loads a plugin and returns its component if successful

func LoadPlugins added in v0.3.0

func LoadPlugins(directory string) []common.Module

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 NewBot

func NewBot(db persistence.Database) *Bot

NewBot creates a new bot instance

func (*Bot) InitalizeExternalChat added in v0.4.2

func (app *Bot) InitalizeExternalChat(channel *core.Channel, chat common.ExternalChatModule)

func (*Bot) Initialize

func (app *Bot) Initialize(cfg *core.Config) error

Initalize creates the discord session and registers handlers

func (*Bot) Notify

func (app *Bot) Notify(message string)

Notify sends a message to the notification channe;

func (*Bot) Run

func (app *Bot) Run() error

Run opens the session with Discord until exit

func (*Bot) Stop

func (app *Bot) Stop()

Stop triggers a graceful shutdown of the app

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL