mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🐞 fix: 解决网络错误带来的控制台报错
This commit is contained in:
parent
0155a5662e
commit
6fc36501e1
@ -367,19 +367,19 @@ export class tools extends plugin {
|
||||
|
||||
// 如果有ck 并且 有openai的key
|
||||
if (this.biliSessData && this.openaiApiKey) {
|
||||
let prompt;
|
||||
try {
|
||||
prompt = await getBiliGptInputText(
|
||||
const prompt = await getBiliGptInputText(
|
||||
{ title, desc, dynamic, aid, cid },
|
||||
this.biliSessData,
|
||||
);
|
||||
const response = await this.chatGptClient.sendMessage(prompt);
|
||||
// 暂时不设计上下文
|
||||
e.reply(response.response);
|
||||
} catch (err) {
|
||||
logger.error("总结失败,可能是没有弹幕或者网络问题!\n", err);
|
||||
return true;
|
||||
}
|
||||
const response = await this.chatGptClient.sendMessage(prompt);
|
||||
// 暂时不设计上下文
|
||||
e.reply(response.response);
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user