Files
goodBaby/drivers/onebot/runner.go
T
mei 9b656cebee
Quality check / Web UI (push) Successful in 9m19s
feat(gateway): 优化gateway相关功能
2026-09-12 15:32:27 +08:00

29 lines
516 B
Go

package onebot
import (
"context"
"github.com/ssdomei232/goodBaby/model"
)
// OneBotExecutor OneBot执行器
type OneBotExecutor struct{}
func (e *OneBotExecutor) GetType() string {
return RuleType
}
func (e *OneBotExecutor) Execute(ctx context.Context, task *model.RuleTask) error {
account, err := ParseAccountConfig(task.AccountConfig())
if err != nil {
return err
}
config, err := ParseRuleConfig(task.Rule.ConfigJson)
if err != nil {
return err
}
return SendMessage(ctx, account, config)
}