app

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: MIT Imports: 8 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
	// contains filtered or unexported fields
}

func NewBot

func NewBot() *Bot

NewBot creates a new bot instance

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) *ComponentLoader

func (*ComponentLoader) CreateEvent added in v0.3.0

func (loader *ComponentLoader) CreateEvent(event common.Event) error

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) RegisterChatSyncModule added in v0.3.0

func (loader *ComponentLoader) RegisterChatSyncModule(ID string, plugin common.ChatSyncModule) error

Jump to

Keyboard shortcuts

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