🐞 fix: 修复R文档只能管理员更新的问题

This commit is contained in:
zhiyu1998 2024-09-10 22:43:52 +08:00
parent 862c8acfae
commit 52371b339f

View File

@ -362,9 +362,13 @@ export class query extends plugin {
e.reply("请输入要查询的文档内容!\n例如#R文档 如何玩转BBDown"); e.reply("请输入要查询的文档内容!\n例如#R文档 如何玩转BBDown");
return; return;
} else if (question === "更新" || rPluginDocument?.content === undefined) { } else if (question === "更新" || rPluginDocument?.content === undefined) {
// 权限判定
if (!e.isMaster) {
e.reply("请让管理员发送以进行初始化,或者让管理员进行更新!");
return;
}
e.reply("更新文档中..."); e.reply("更新文档中...");
const content = await llmRead(RDOC_LINK); const content = await llmRead(RDOC_LINK);
logger.info(content);
await redisSetKey(REDIS_YUNZAI_RDOC, { await redisSetKey(REDIS_YUNZAI_RDOC, {
content content
}) })
@ -384,7 +388,6 @@ export class query extends plugin {
} else { } else {
logger.info(RDOC_AI_PROMPT.replace("{}", question)); logger.info(RDOC_AI_PROMPT.replace("{}", question));
kimiAns = await deepSeekChat(RDOC_AI_PROMPT.replace("{}", question), rPluginDocument.content); kimiAns = await deepSeekChat(RDOC_AI_PROMPT.replace("{}", question), rPluginDocument.content);
logger.info(kimiAns)
} }
const Msg = await Bot.makeForwardMsg(textArrayToMakeForward(e, [`「R插件 x ${ model }」联合为您总结内容:`, kimiAns])); const Msg = await Bot.makeForwardMsg(textArrayToMakeForward(e, [`「R插件 x ${ model }」联合为您总结内容:`, kimiAns]));
await e.reply(Msg); await e.reply(Msg);