2026-06-19 18:47:36 +08:00
|
|
|
package bilibili
|
2026-06-06 19:31:16 +08:00
|
|
|
|
|
|
|
|
import (
|
2026-07-26 22:19:41 +08:00
|
|
|
"context"
|
2026-06-06 19:31:16 +08:00
|
|
|
"log"
|
|
|
|
|
|
|
|
|
|
"github.com/ssdomei232/goodBaby/model"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// BilibiliDynamicExecutor B站动态执行器
|
|
|
|
|
type BilibiliDynamicExecutor struct{}
|
|
|
|
|
|
|
|
|
|
func (e *BilibiliDynamicExecutor) GetType() string {
|
2026-07-26 22:19:41 +08:00
|
|
|
return RuleTypeDynamic
|
2026-06-06 19:31:16 +08:00
|
|
|
}
|
|
|
|
|
|
2026-07-26 22:19:41 +08:00
|
|
|
func (e *BilibiliDynamicExecutor) Execute(ctx context.Context, rule *model.Rule) error {
|
2026-06-06 19:31:16 +08:00
|
|
|
log.Printf("执行B站动态规则: %s (ID: %d)", rule.Name, rule.ID)
|
|
|
|
|
|
2026-07-26 22:19:41 +08:00
|
|
|
return SendBiliDynamicMsg(ctx, rule)
|
2026-06-06 19:31:16 +08:00
|
|
|
}
|
2026-07-26 23:15:02 +08:00
|
|
|
|
|
|
|
|
// BilibiliPrivateMessageExecutor B站私信执行器
|
|
|
|
|
type BilibiliPrivateMessageExecutor struct{}
|
|
|
|
|
|
|
|
|
|
func (e *BilibiliPrivateMessageExecutor) GetType() string {
|
|
|
|
|
return RuleTypePrivateMessage
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (e *BilibiliPrivateMessageExecutor) Execute(ctx context.Context, rule *model.Rule) error {
|
|
|
|
|
log.Printf("执行B站私信规则: %s (ID: %d)", rule.Name, rule.ID)
|
|
|
|
|
|
|
|
|
|
return SendBiliPrivateMessage(ctx, rule)
|
|
|
|
|
}
|