birdbot/common/module.go

26 lines
626 B
Go
Raw Normal View History

2023-03-30 23:51:05 -04:00
package common
type Module interface {
Initialize(birdbot ModuleManager) error
2023-03-30 23:51:05 -04:00
}
// ModuleManager is the primary way for a module to interact with BirdBot
2023-03-31 20:49:50 +00:00
// by listening to events and committing actions
type ModuleManager interface {
2023-03-30 23:51:05 -04:00
OnReady(func() error) error
OnNotify(func(string) error) error
// Event events
OnEventCreate(func(Event) error) error
OnEventDelete(func(Event) error) error
OnEventUpdate(func(Event) error) error
OnEventComplete(func(Event) error) error
2023-03-31 20:49:50 +00:00
// Actions
2023-03-30 23:51:05 -04:00
CreateEvent(event Event) error
Notify(message string) error
2023-03-31 20:49:50 +00:00
RegisterChatSyncModule(ID string, plugin ChatSyncModule) error
2023-03-30 23:51:05 -04:00
}