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 was merged in pull request #4.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/yeslayla/birdbot/common"
|
||||
@@ -50,8 +49,14 @@ func (loader *ComponentLoader) OnEventComplete(handler func(common.Event) error)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (loader *ComponentLoader) RegisterChatSyncModule(ID string, plugin common.ChatSyncModule) error {
|
||||
return fmt.Errorf("unimplemented")
|
||||
func (loader *ComponentLoader) RegisterExternalChat(channelID string, chat common.ExternalChatModule) error {
|
||||
if _, ok := loader.bot.channelChats[channelID]; !ok {
|
||||
loader.bot.channelChats[channelID] = []common.ExternalChatModule{}
|
||||
}
|
||||
|
||||
loader.bot.channelChats[channelID] = append(loader.bot.channelChats[channelID], chat)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (loader *ComponentLoader) CreateEvent(event common.Event) error {
|
||||
|
||||
Reference in New Issue
Block a user