External Chat Linking (!4)

This PR adds the functionality for plugins to send and recieve messages linked to a specific channel.

Co-authored-by: Layla <layla@layla.gg>
Reviewed-on: https://gitea.sumulayla.synology.me/layla/birdbot/pulls/4
This commit is contained in:
2023-06-17 19:38:47 -04:00
parent b252d5e62e
commit 73a63fbf4d
12 changed files with 207 additions and 17 deletions

View File

@ -1,6 +0,0 @@
package common
type ChatSyncModule interface {
SendMessage(user string, message string)
RecieveMessage(user User, message string)
}

11
common/external_chat.go Normal file
View File

@ -0,0 +1,11 @@
package common
type ExternalChatManager interface {
SendMessage(user string, message string)
}
type ExternalChatModule interface {
Initialize(ExternalChatManager)
RecieveMessage(user User, message string)
}

View File

@ -24,5 +24,6 @@ type ModuleManager interface {
// Commands
RegisterCommand(string, ChatCommandConfiguration, func(User, map[string]any) string)
RegisterChatSyncModule(ID string, plugin ChatSyncModule) error
// Submodules
RegisterExternalChat(channelID string, chat ExternalChatModule) error
}