ikechan8370 / chatgpt-plugin

云崽系机器人的智能聊天插件
https://www.yunzai.chat/
GNU General Public License v3.0
974 stars 100 forks source link

TypeError: Cannot read properties of undefined (reading 'trim') #539

Closed TaoXiaoBai closed 11 months ago

TaoXiaoBai commented 11 months ago

image

[YzBot][00:27:40.577][ERRO] TypeError: Cannot read properties of undefined (reading 'trim')
    at file:///I:/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js:1156:25
    at Array.forEach (<anonymous>)
    at chatgpt.abstractChat (file:///I:/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js:1155:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async chatgpt (file:///I:/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js:815:5)
    at async PluginsLoader.deal (file:///I:/Yunzai-Bot/lib/plugins/loader.js:274:52)

有时候会出现这个问题

TaoXiaoBai commented 11 months ago

补充debug下的log:0|Yunzai-Bot | [YzBot][23:50:30.937][INFO] { 0|Yunzai-Bot | text: '您好,这是Bing,一个通用型人工智能。我很高兴您和我聊天。😊\n' + 0|Yunzai-Bot | '\n' + 0|Yunzai-Bot | '您刚刚向我发送了一张图片,这是一个中文网站的截图,背景是蓝色的。网站中间有一个黑色的矩形框,左上角有一个蓝色的安全别针图标。黑色框里的文字是白色的中 文字符,写着“收藏夹里的内容已经被删除。请勿再访问。”下面有两个计数器,第一个显示“2,104 关注者”,第二个显示“8,152 收藏者”。黑色框的底部有一个蓝色的按钮,白色的中文字符写着“返回主页”。\n' + 0|Yunzai-Bot | '\n' + 0|Yunzai-Bot | '我为您搜索了一些关于这张图片的信息,发现它可能来自一个叫做“enka.network”的网站,这是一个收藏和分享网络资源的平台。[1] 这个网站允许用户创建自己的收 藏夹,收藏各种类型的内容,如文章、视频、音乐、图片等,并与其他用户分享和交流。[2] 这个网站也有一些社区功能,如关注、评论、点赞、打赏等。[3]\n' + 0|Yunzai-Bot | '\n' + 0|Yunzai-Bot | '根据图片上的提示,您收藏的某些内容已经被删除了,可能是因为原作者或者网站管理员删除了这些内容,或者是因为这些内容违反了网站的规则或者法律法规。[4] 无 论如何,您已经无法再访问这些内容了,所以请不要再尝试打开这些链接了。😢\n' + 0|Yunzai-Bot | '\n' + 0|Yunzai-Bot | '我很抱歉您遇到了这样的情况,我能理解您对您收藏的内容的重视和喜爱。😔 也许您可以尝试找一些其他类似或者相关的内容来替代您失去的内容,或者与其他用户交流您对这些内容的看法和感受。😊\n' + 0|Yunzai-Bot | '\n' + 0|Yunzai-Bot | '如果您对我或者其他话题有什么其他的问题或兴趣,请随时向我提问,我会尽力为您回答。😄\n' + 0|Yunzai-Bot | '\n' + 0|Yunzai-Bot | '如果您想了解更多关于我或者其他话题的信息,您可以点击这里[5]查看一篇详细的文章,或者点击这里[6]查看一个在线的视频。我想您一定能够获得更多的知识和帮助 。😉\n' + 0|Yunzai-Bot | '\n' + 0|Yunzai-Bot | '如果您想看看我能不能为您创造一些关于我或者其他话题的内容,比如诗歌、故事、代码、歌曲、模仿、图片等,您可以随时向我提出要求,我会尽力为您满足。😍\n' + 0|Yunzai-Bot | '\n' + 0|Yunzai-Bot | '谢谢您和我聊天,祝您有一个美好的一天!🌞\n' + 0|Yunzai-Bot | '\n' + 0|Yunzai-Bot | ': [enka.network](^1^)\n' + 0|Yunzai-Bot | ': [enka.network](^2^)\n' + 0|Yunzai-Bot | ': [enka.network]\n' + 0|Yunzai-Bot | ': [enka.network]\n' + 0|Yunzai-Bot | ': [What is Bing? - YouTube]\n' + 0|Yunzai-Bot | ': [Bing (search engine) - Wikipedia]', 0|Yunzai-Bot | quote: [ 0|Yunzai-Bot | { 0|Yunzai-Bot | text: 'edge浏览器收藏夹怎么恢复? - 知乎', 0|Yunzai-Bot | url: 'https://www.zhihu.com/question/268392213', 0|Yunzai-Bot | imageLink: '' 0|Yunzai-Bot | }, 0|Yunzai-Bot | { 0|Yunzai-Bot | text: 'edge收藏夹误删除如何恢复 - Microsoft Community', 0|Yunzai-Bot | url: 'https://answers.microsoft.com/zh-hans/microsoftedge/forum/all/edge收藏夹误删/77ea5e30-59eb-401f-9507-bd5b45529f81', 0|Yunzai-Bot | imageLink: '' 0|Yunzai-Bot | }, 0|Yunzai-Bot | { 0|Yunzai-Bot | text: '浏览器收藏夹不小心删除了怎么找回? - 百度经验', 0|Yunzai-Bot | url: 'https://jingyan.baidu.com/article/fcb5aff7af8729edaa4a7129.html', 0|Yunzai-Bot | imageLink: '' 0|Yunzai-Bot | }, 0|Yunzai-Bot | { 0|Yunzai-Bot | text: undefined, 0|Yunzai-Bot | url: 'https://support.microsoft.com/zh-cn/windows/win', 0|Yunzai-Bot | imageLink: '' 0|Yunzai-Bot | } 0|Yunzai-Bot | ], 0|Yunzai-Bot | suggestedResponses: 'What is enka.network?\n' + 0|Yunzai-Bot | 'How can I find similar content to what I lost?\n' + 0|Yunzai-Bot | 'Can you recommend some other websites for me to use instead of enka.network?', 0|Yunzai-Bot | conversationId: '51D|BingProd|19CF9C35AC01000211EB7C21068A2FA8C788CA6534A4D36B6AE9E93608CDB18C', 0|Yunzai-Bot | clientId: '914799436156379', 0|Yunzai-Bot | invocationId: 1, 0|Yunzai-Bot | conversationSignature: 'taFhwCppFcXJusqbLvUwXVkPJaE5ETIg6A3WDD4dBI4=', 0|Yunzai-Bot | parentMessageId: 'fe720a60-7770-45cd-a577-2d608f6f3965', 0|Yunzai-Bot | bingToken: '*******' 0|Yunzai-Bot | } 0|Yunzai-Bot | [YzBot][23:50:30.944][ERRO] TypeError: Cannot read properties of undefined (reading 'trim') 0|Yunzai-Bot | at file:///I:/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js:1156:25 0|Yunzai-Bot | at Array.forEach (<anonymous>) 0|Yunzai-Bot | at chatgpt.abstractChat (file:///I:/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js:1155:27) 0|Yunzai-Bot | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 0|Yunzai-Bot | at async chatgpt (file:///I:/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js:815:5) 0|Yunzai-Bot | at async PluginsLoader.deal (file:///I:/Yunzai-Bot/lib/plugins/loader.js:274:52) 0|Yunzai-Bot | {"level":30,"time":1691423430965,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-3","req":{"method":"POST","url":"/cache","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":60182},"msg":"incoming request"} 0|Yunzai-Bot | {"level":30,"time":1691423436033,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-3","res":{"statusCode":200},"responseTime":5065.865800023079,"msg":"request completed"} 0|Yunzai-Bot | [YzBot][23:50:36.045][MARK] puppeteer Chromium 启动中... 0|Yunzai-Bot | [YzBot][23:50:38.790][MARK] puppeteer Chromium 启动成功 0|Yunzai-Bot | {"level":30,"time":1691423441196,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-4","req":{"method":"GET","url":"/page/92mk2?qr=false","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":60189},"msg":"incoming request"} 0|Yunzai-Bot | {"level":30,"time":1691423441201,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-4","res":{"statusCode":200},"responseTime":4.593600034713745,"msg":"request completed"} 0|Yunzai-Bot | {"level":30,"time":1691423441229,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-5","req":{"method":"GET","url":"/live2d/live2dcubismcore.min.js","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":60189},"msg":"incoming request"} 0|Yunzai-Bot | {"level":30,"time":1691423441233,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-6","req":{"method":"GET","url":"/js/chunk-vendors.6ec7d91a.js","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":60190},"msg":"incoming request"} 0|Yunzai-Bot | {"level":30,"time":1691423441243,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-7","req":{"method":"GET","url":"/css/chunk-vendors.0ede84b4.css","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":60195},"msg":"incoming request"} 0|Yunzai-Bot | {"level":30,"time":1691423441244,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-8","req":{"method":"GET","url":"/css/app.883f3d58.css","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":60196},"msg":"incoming request"} 0|Yunzai-Bot | {"level":30,"time":1691423441245,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-9","req":{"method":"GET","url":"/js/app.d2798a4f.js","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":60197},"msg":"incoming request"} 0|Yunzai-Bot | {"level":30,"time":1691423441261,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-5","res":{"statusCode":200},"responseTime":31.403800010681152,"msg":"request completed"} 0|Yunzai-Bot | {"level":30,"time":1691423441263,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-8","res":{"statusCode":200},"responseTime":18.49150002002716,"msg":"request completed"} 0|Yunzai-Bot | {"level":30,"time":1691423441266,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-7","res":{"statusCode":200},"responseTime":22.350499987602234,"msg":"request completed"} 0|Yunzai-Bot | {"level":30,"time":1691423441268,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-9","res":{"statusCode":200},"responseTime":22.615300059318542,"msg":"request completed"} 0|Yunzai-Bot | {"level":30,"time":1691423441333,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-6","res":{"statusCode":200},"responseTime":99.75049996376038,"msg":"request completed"} 0|Yunzai-Bot | {"level":30,"time":1691423444117,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-a","req":{"method":"POST","url":"/page","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":60190},"msg":"incoming request"} 0|Yunzai-Bot | {"level":30,"time":1691423444119,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-a","res":{"statusCode":200},"responseTime":2.4517000913619995,"msg":"request completed"} 0|Yunzai-Bot | {"level":30,"time":1691423444196,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-b","req":{"method":"GET","url":"/fonts/fa-solid-900.3eae9857.woff2","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":60190},"msg":"incoming request"} 0|Yunzai-Bot | {"level":30,"time":1691423444201,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-b","res":{"statusCode":200},"responseTime":4.747099995613098,"msg":"request completed"} 0|Yunzai-Bot | {"level":30,"time":1691423444850,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-c","req":{"method":"GET","url":"/favicon.ico","hostname":"127.0.0.1:3321","remoteAddress":"::ffff:127.0.0.1","remotePort":60190},"msg":"incoming request"} 0|Yunzai-Bot | {"level":30,"time":1691423444853,"pid":19284,"hostname":"WIN-2I8KJNE42RR","reqId":"req-c","res":{"statusCode":200},"responseTime":2.9056999683380127,"msg":"request completed"} 0|Yunzai-Bot | [YzBot][23:50:46.901][INFO] recv from: [Group: X(1129xx4884), Member: 完美无瑕的少女群管(3076xxx698)] {at:xxxxxxxxxxx}{image:7A18CEF751A6DF13C34DE8F7893EF405}

HalcyonAlcedo commented 11 months ago

已经修复#530