-
Notifications
You must be signed in to change notification settings - Fork 2k
Feature airecord 20250704 #1180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feature airecord 20250704 #1180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果想做分群的设置,最好用数据库然后在每个群直接发消息设置,避免手动输入群号。否则,就全搞成private避免打扰/误触发。
recCfg := airecord.RecCfg | ||
if !cfg.NoRecord { | ||
record := ctx.GetAIRecord(recCfg.ModelID, recCfg.Customgid, t) | ||
if record != "" { | ||
ctx.SendChain(message.Record(record)) | ||
} else { | ||
if id != nil { | ||
id = ctx.SendChain(message.Reply(id), message.Text(t)) | ||
} else { | ||
id = ctx.SendChain(message.Text(t)) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recCfg := airecord.RecCfg | |
if !cfg.NoRecord { | |
record := ctx.GetAIRecord(recCfg.ModelID, recCfg.Customgid, t) | |
if record != "" { | |
ctx.SendChain(message.Record(record)) | |
} else { | |
if id != nil { | |
id = ctx.SendChain(message.Reply(id), message.Text(t)) | |
} else { | |
id = ctx.SendChain(message.Text(t)) | |
} | |
} | |
record := "" | |
if !cfg.NoRecord { | |
record = ctx.GetAIRecord(recCfg.ModelID, recCfg.Customgid, t) | |
} | |
if record != "" { | |
ctx.SendChain(message.Record(record)) |
ctx.SendChain(message.Text("ERROR: parse gid err: ", err)) | ||
return | ||
} | ||
err = airecord.SetCustomGID(num) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得这个没必要放到animeapi,维护也不方便。可以直接移到当前目录,使用en.DataFolder()而非直接写死路径。
} | ||
ctx.SendChain(message.Text("设置AI语音群号为", num)) | ||
}) | ||
en.OnFullMatch("设置AI语音模型", zero.SuperUserPermission).SetBlock(true). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onlyprivate
PrivateDataFolder: "airecord", | ||
}) | ||
|
||
en.OnPrefix("设置AI语音群号", zero.SuperUserPermission).SetBlock(true). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onlyprivate
} | ||
} | ||
}) | ||
en.OnFullMatch("查看AI语音配置").SetBlock(true). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
superuser, onlyprivate
recCfg := airecord.RecCfg | ||
ctx.SendChain(message.Text(airecord.PrintRecordConfig(recCfg))) | ||
}) | ||
en.OnPrefix("发送AI语音").SetBlock(true). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
groupadmin
engine.OnFullMatch("群签到", zero.OnlyGroup).SetBlock(true).Limit(ctxext.LimitByUser). | ||
Handle(func(ctx *zero.Ctx) { | ||
ctx.SetGroupSign(ctx.Event.GroupID) | ||
ctx.SendChain(message.Text("群签到成功,可在手机端输入框中的打卡查看")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不能根据返回值检查是否真的成功?
No description provided.