feat: domain blocker plugin
Some checks failed
ci/woodpecker/tag/release Pipeline was successful
ci/woodpecker/push/ci Pipeline failed

This commit is contained in:
Felipe M 2025-04-22 18:09:27 +02:00
parent c9edb57505
commit 7dd02c0056
Signed by: fmartingr
GPG key ID: CCFBC5637D4000A8
25 changed files with 898 additions and 63 deletions

View file

@ -1,6 +1,7 @@
package plugin
import (
"maps"
"sync"
"git.nakama.town/fmartingr/butterrobot/internal/model"
@ -41,9 +42,7 @@ func GetAvailablePlugins() map[string]model.Plugin {
// Create a copy to avoid race conditions
result := make(map[string]model.Plugin, len(plugins))
for id, plugin := range plugins {
result[id] = plugin
}
maps.Copy(result, plugins)
return result
}
@ -77,6 +76,6 @@ func (p *BasePlugin) RequiresConfig() bool {
}
// OnMessage is the default implementation that does nothing
func (p *BasePlugin) OnMessage(msg *model.Message, config map[string]interface{}) []*model.Message {
func (p *BasePlugin) OnMessage(msg *model.Message, config map[string]interface{}) []*model.MessageAction {
return nil
}