feat(aichat): add OLLaMA & GenAI support

This commit is contained in:
源文雨
2025-03-30 21:36:31 +09:00
parent a29f4cb1f9
commit 2df52161e5
7 changed files with 119 additions and 42 deletions

View File

@@ -32,7 +32,7 @@ type favorability struct {
func init() {
// 好感度系统
engine.OnMessage(zero.NewPattern().Text(`^查好感度`).At().AsRule(), zero.OnlyGroup, getdb).SetBlock(true).Limit(ctxext.LimitByUser).
engine.OnMessage(zero.NewPattern(nil).Text(`^查好感度`).At().AsRule(), zero.OnlyGroup, getdb).SetBlock(true).Limit(ctxext.LimitByUser).
Handle(func(ctx *zero.Ctx) {
patternParsed := ctx.State[zero.KeyPattern].([]zero.PatternParsed)
fiancee, _ := strconv.ParseInt(patternParsed[1].At(), 10, 64)
@@ -49,7 +49,7 @@ func init() {
)
})
// 礼物系统
engine.OnMessage(zero.NewPattern().Text(`^买礼物给`).At().AsRule(), zero.OnlyGroup, getdb).SetBlock(true).Limit(ctxext.LimitByUser).
engine.OnMessage(zero.NewPattern(nil).Text(`^买礼物给`).At().AsRule(), zero.OnlyGroup, getdb).SetBlock(true).Limit(ctxext.LimitByUser).
Handle(func(ctx *zero.Ctx) {
gid := ctx.Event.GroupID
uid := ctx.Event.UserID