Discord Components & Role Selection (#5)

This commit is contained in:
2023-04-01 01:23:37 -04:00
committed by GitHub
parent 5e6a433b92
commit e1038a15cd
25 changed files with 696 additions and 31 deletions

25
common/module.go Normal file
View File

@ -0,0 +1,25 @@
package common
type Module interface {
Initialize(birdbot ModuleManager) error
}
// ModuleManager is the primary way for a module to interact with BirdBot
// by listening to events and committing actions
type ModuleManager interface {
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
// Actions
CreateEvent(event Event) error
Notify(message string) error
RegisterChatSyncModule(ID string, plugin ChatSyncModule) error
}