This commit is contained in:
parent
c53942ac53
commit
d09b763aa7
24 changed files with 941 additions and 17 deletions
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue