Files
goodBaby/drivers/onebot/runner.go
T

29 lines
516 B
Go
Raw Normal View History

2026-06-19 18:47:36 +08:00
package onebot
import (
2026-07-26 22:19:41 +08:00
"context"
"github.com/ssdomei232/goodBaby/model"
)
// OneBotExecutor OneBot执行器
type OneBotExecutor struct{}
func (e *OneBotExecutor) GetType() string {
2026-07-26 22:19:41 +08:00
return RuleType
}
2026-09-12 15:32:27 +08:00
func (e *OneBotExecutor) Execute(ctx context.Context, task *model.RuleTask) error {
account, err := ParseAccountConfig(task.AccountConfig())
if err != nil {
return err
}
2026-09-12 15:32:27 +08:00
config, err := ParseRuleConfig(task.Rule.ConfigJson)
if err != nil {
return err
}
return SendMessage(ctx, account, config)
}