🐞 fix: 修复如果没有key依然总结wx的bug

This commit is contained in:
zhiyu 2024-05-24 17:43:36 +08:00
parent f58b5da14d
commit 15fd062380

View File

@ -1541,6 +1541,11 @@ export class tools extends plugin {
}
async weixin(e) {
// 判断是否有总结的条件
if (_.isEmpty(this.aiApiKey) || _.isEmpty(this.aiApiKey)) {
e.reply("没有配置 Kimi无法为您的微信文章总结\n文档https://gitee.com/kyrzy0416/rconsole-plugin")
return true;
}
const urlReg = /(?:https?:\/\/)?mp\.weixin\.qq\.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
const wxUrl = urlReg.exec(e.msg)?.[0];
const builder = await new OpenaiBuilder()