feat: hltb plugin
Some checks failed
ci/woodpecker/push/ci Pipeline failed

This commit is contained in:
Felipe M 2025-06-12 14:45:07 +02:00
parent c53942ac53
commit d09b763aa7
Signed by: fmartingr
GPG key ID: CCFBC5637D4000A8
24 changed files with 941 additions and 17 deletions

View file

@ -41,7 +41,7 @@ func New(creator ReminderCreator) *Reminder {
}
// OnMessage processes incoming messages
func (r *Reminder) OnMessage(msg *model.Message, config map[string]interface{}) []*model.MessageAction {
func (r *Reminder) OnMessage(msg *model.Message, config map[string]interface{}, cache model.CacheInterface) []*model.MessageAction {
// Only process replies to messages
if msg.ReplyTo == "" {
return nil

View file

@ -5,6 +5,7 @@ import (
"time"
"git.nakama.town/fmartingr/butterrobot/internal/model"
"git.nakama.town/fmartingr/butterrobot/internal/testutil"
)
// MockCreator is a mock implementation of ReminderCreator for testing
@ -142,7 +143,8 @@ func TestReminderOnMessage(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
initialCount := len(creator.reminders)
actions := plugin.OnMessage(tt.message, nil)
mockCache := &testutil.MockCache{}
actions := plugin.OnMessage(tt.message, nil, mockCache)
if tt.expectResponse && len(actions) == 0 {
t.Errorf("Expected response action, but got none")