Coder Social home page Coder Social logo

ikechan8370 / chatgpt-plugin Goto Github PK

View Code? Open in Web Editor NEW
959.0 7.0 100.0 33.94 MB

云崽系机器人的智能聊天插件

Home Page: https://www.yunzai.chat/

License: GNU General Public License v3.0

JavaScript 90.65% CSS 0.82% HTML 1.48% TypeScript 7.05%
bot chatgpt qq yunzai yunzai-bot

chatgpt-plugin's Introduction

chatgpt-plugin

26224FE397F1E74104C1C007C1A32DDE

推荐的相关文档和参考资料

本README 手册 文档1(建设中) 插件常见问题(鹤望兰版) Yunzai常见问题(LUCK小运版) 憨憨博客

特点

  • 支持单人连续对话Conversation
  • API模式下,使用 gpt-3.5-turbo 或 gpt-4 API,仅需OpenAI Api Key,开箱即用。注意收费
  • 支持问答图片截图和聊天记录导出
  • 支持AI性格调教,角色扮演强烈推荐Bing自定义模式
  • 支持对接vits和Azure等回答直接转语音
  • API3模式下,绕过Cloudflare防护直接访问ChatGPT的SSE API,与官方体验一致,且保留对话记录,在官网可查。免费。
  • (已不再维护)提供基于浏览器的解决方案作为备选,API3不可用的情况下或担心账户安全的用户可以选择使用浏览器模式。
  • 支持新必应(token负载均衡,限流降级)
  • 2023-03-15 API3支持GPT-4尝鲜,需要Plus用户(疑似被官方阻断暂不支持api3的gpt4)
  • 支持ChatGLM模型。基于自建API
  • 2023-04-15 支持Claude by Slack和Poe(WIP)。Claude配置参考这里
  • 2023-05-12 支持星火大模型
  • 2023-05-29 支持gpt-4 API.必应无需cookie即可对话(Sydney和自定义模式)
  • 2023-07 支持智能模式,机器人可以实现禁言、群名片/头衔(需给机器人管理员/群主)、分享音乐视频、主动发音频、对接ap,sr和喵喵等插件、联网搜索等,需api模式0613系列模型。智能模式所需的额外api和搜索api分别可以参考chatgpt-plugin-extrassearch-api 自行搭建,其中后者提供了一个公益版本,前者可使用huggingface部署
  • 2023-09-10 支持来自claude.ai的claude-2模型
  • 2023-10-19 支持读取文件,(目前适配必应模式和Claude2模式)
  • 2023-10-25 增加支持通义千问官方API
  • 2023-12-01 持续优先适配Shamrock
  • 2023-12-14 增加支持Gemini 官方API

如果觉得这个插件有趣或者对你有帮助,请点一个star吧!

版本要求

Node.js >= 18 / Node.js >= 14(with node-fetch) 小白尽可能使用18版本以上的nodejs

安装与使用方法

安装

  1. 进入 Yunzai根目录

  2. 请将 chatgpt-plugin 放置在 Yunzai-Bot 的 plugins 目录下

推荐使用 git 进行安装,以方便后续升级。在 Yunzai-Bot 根目录夹打开终端,运行下述指令进行安装

# github源
git clone --depth=1 https://github.com/ikechan8370/chatgpt-plugin.git ./plugins/chatgpt-plugin/

# 网络不好连不上github可以使用gitee源,但更新可能不如github及时
git clone --depth=1 https://gitee.com/ikechan/chatgpt-plugin.git ./plugins/chatgpt-plugin/

# 以上二选一后执行下面步骤进入目录安装依赖
cd plugins/chatgpt-plugin
pnpm i

如果是手工下载的 zip 压缩包,请将解压后的 chatgpt-plugin 文件夹(请删除压缩自带的-master或版本号后缀)放置在 Yunzai-Bot 目录下的 plugins 文件夹内

  1. 修改配置 本插件配置项比较多,强烈建议使用后台工具箱或锅巴面板修改

    或者创建和编辑config/config.json文件。

  2. 后台面板使用 初次使用请先私聊机器人 #设置管理密码 进登录密码设置 私聊 #chatgpt系统管理 后机器人会回复系统管理页面网址,在此网址输入机器人QQ号和刚刚设置的管理密码点击登录即可进入后台管理系统 如果忘记密码,再次私聊输入 #设置管理密码 后可重新设置密码

    用户同样可私聊机器人 #设置用户密码 进行账号注册和密码设置 用户设置密码后,所有聊天信息将记录在用户缓存数据下,同时用户可通过私聊机器人 #chatgpt用户配置 登录后台用户配置面板,查看自己的聊天数据和自定义机器人对自己的回复参数

    如果后台面板访问出现 time out 请检查机器人启动时是否有报错,服务器端口是否开放,可尝试ping一下服务器ip看能否直接ping通。

  3. 重启Yunzai-Bot 如通过后台面板或锅巴面板升级可以热加载,无需重启。


相关配置

配置文件相关

配置文件位置:plugins/chatgpt-plugin/config/config.json

部分关键配置项,其他请参照文件内注释:

名称 含义 解释
proxy 代理地址 请在此处配置你的代理,例如http://127.0.0.1:7890
apiKey openai账号的API Key 获取地址:https://platform.openai.com/account/api-keys

Token相关

与Token相关的设置需在qq与机器人对话设置,设置后方可使用对应的api

名称 含义 解释 设置方式
ChatGPT AccessToken ChatGPT登录后的Token 具体解释见下方 #chatgpt设置token
必应token 必应登录后的Token 必应(Bing)将调用微软必应AI接口进行对话。不填写token对话上限为5句,填写后为20句。无论填写与否插件都会无限续杯。 #chatgpt设置必应token/#chatgpt删除必应token/#chatgpt查看必应token

我没有注册openai账号?如何获取

您可以按照以下方法获取openai账号

进入https://chat.openai.com/ ,选择signup注册。目前openai不对包括俄罗斯、乌克兰、伊朗、**等国家和地区提供服务,所以自行寻找办法使用其他国家和地区的ip登录。此外,注册可能需要验证所在国家和地区的手机号码,如果没有国外手机号可以试试解码网站,收费的推荐https://sms-activate.org/

我有openai账号了,如何获取API key和Access Token?

  • 获取API key

  • 获取Access Token

    • 登录后访问https://chat.openai.com/api/auth/session
    • 您会获得类似如下一串json字符串{"user":{"id":"AAA","name":"BBB","email":"CCC","image":"DDD","picture":"EEE","groups":[]},"expires":"FFF","accessToken":"XXX"}
    • 其中的XXX即为ChatGPT AccessToken
    • 如果是空的{},说明没有登录,要登录chatgpt而不是openai。

ChatGPT AccessToken 设置了有什么用?我为什么用不了API模式

  • 部分API需要在和机器人的聊天里输入#chatgpt设置token才可以使用

我有新必应的测试资格了,如何获取必应Token?

2023/05/29 无需登录也可以使用了,要求不高可以不填

  1. JS一键获取

登录www.bing.com,刷新一下网页,按F12或直接打开开发者模式,点击Console/控制台,运行如下代码,执行后即在您的剪切板存储了必应Token

copy(document.cookie.split(";").find(cookie=>cookie.trim().startsWith("_U=")).split("=")[1]);
  1. 手动获取

登录www.bing.com,刷新一下网页,按F12或直接打开开发者模式,点击Application/存储,点击左侧Storage下的Cookies,展开找到https://www.bing.com 项,在右侧列表Name项下找到"_U",_U的value即为必应Token

其他问题可以参考使用的api库 https://github.com/transitive-bullshit/chatgpt-api 以及 https://github.com/waylaidwanderer/node-chatgpt-api

使用方法

根据配置文件中的toggleMode决定联通方式。

  • at模式:@机器人 发送聊内容即可

  • prefix模式:【#chat+问题】,本模式可以避免指令冲突。

发挥你的想象力吧,调教拟造出你自己的机器人风格!

文本/图片回复模式

#chatgpt文本/图片/语音模式

可以控制机器人回复的方式

对话相关

#chatgpt对话列表

#结束对话 [@某人]

#清空chat队列

#移出chat队列首位

#chatgpt开启/关闭问题确认

...

设置相关

#chatgpt切换浏览器/API/API2/API3/Bing

#chatgpt设置[必应]Token

...

获取帮助

#chatgpt帮助

#chatgpt模式帮助

发送#chatgpt帮助,有更多选项可以配置

如何更新

发送#chatgpt更新指令。如果有冲突,可以使用#chatgpt强制更新。

示例与截图

  • 程序员版

img.png

  • 傲娇版

)T@XYNWXUM S1)D$7%I3H image

TODO

  • V3重构
  • 插件in插件
  • langchain分支完善
  • 游戏机制

其他

常见问题

  1. 如果在linux系统上发现图片模式下emoj无法正常显示,可以搜索安装支持emoj的字体,如Ubuntu可以使用sudo apt install fonts-noto-color-emoji

  2. 我和机器人聊天但没有任何反应怎么办?

    可能是由于Yunzai-bot异常退出等原因造成Redis 队列中有残留的等待问题。使用#清空队列命令清除队列后再试。

  3. Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'xxx'.

    请参照本文档前面的安装依赖部分重新依赖。随着项目更新可能引入新的依赖。

    一般情况下请按照 安装 小节的内容重新安装依赖即可

    最多的问题:载入插件错误:chat

    问题详情:Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'showdown' imported from /app/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js

    原因:没装依赖

    解决方式:请参考文档在本插件目录下用pnpm install安装依赖,安装完就不报错了

  4. 反代能自己搭吗?

    能。参考这里

    必应可以用azurecloudflare workers的serverless服务:

    (202307 Cloudflare亡了!)

  5. vit API能本地搭建吗?

    能。克隆下来安装依赖直接运行即可。

  6. 系统后台无法进入怎么办?

    多数情况下是由于服务器未开放3321端口导致,请根据服务器系统和服务器供应商配置,开放3321端口后再试。

交流群

  • QQ 559567232 [问题交流]
  • QQ 126132049 [机器人试验场]

感谢

本项目使用或参考了以下开源项目

本插件的辅助项目

图片以及Bing模式支持 @HalcyonAlcedo

语音vits模型来自于

以及ChatGPT及OpenAI

ChatGLM

赞助

如果觉得本项目好玩或者对你有帮助,愿意的话可以赞助我一口快乐水:

https://afdian.net/a/ikechan8370

贡献者

感谢以下贡献者

Alt

Star History

Star History Chart

工具支持

JetBrains for Open Source development license

chatgpt-plugin's People

Contributors

127wzc avatar 2ndelement avatar ayakasuki avatar cj0928 avatar elaineowo avatar err0rcm avatar halcyonalcedo avatar hanhan258 avatar hewang1an avatar ifeif avatar ikechan8370 avatar ixuan789 avatar k2lin-daniel avatar kae-mihara avatar keaiye avatar lori255 avatar misaka20002 avatar oishiimono avatar qz-sean avatar sanqianqvq avatar sigeisment avatar timerainstarsky avatar xcating avatar xfdown avatar yysforget avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatgpt-plugin's Issues

过长的输出

qq消息字数限制,过长的文字会被截断。准备对过长的文字切分。

关于chargpt换成openai

目前chatgpt每过2小时需要重新写Cookies
想改成调用openai这个库不知道怎么修改 你可以说下应该怎么修改吗?
看了你的源代码 无从下手

更新后启动报错 删了重下和更新都试了

chatgpt插件已加载
0|Yunzai-Bot | Can't load MathJax.js from file:///D:/工具/bot/Yunzai-Bot/node_modules/.pnpm/[email protected]/node_modules/mathjax/unpacked/MathJax.js
0|Yunzai-Bot | Error: Could not load script: "file:///D:/%E5%B7%A5%E5%85%B7/bot/Yunzai-Bot/node_modules/.pnpm/[email protected]/node_modules/mathjax/unpacked/MathJax.js"
0|Yunzai-Bot | at D:\工具\bot\Yunzai-Bot\node_modules.pnpm\[email protected]\node_modules\jsdom\lib\jsdom\browser\resource-loader.js:44:23
0|Yunzai-Bot | at Object.check (D:\工具\bot\Yunzai-Bot\node_modules.pnpm\[email protected]\node_modules\jsdom\lib\jsdom\living\nodes\Document-impl.js:76:11)
0|Yunzai-Bot | at ReadStream. (D:\工具\bot\Yunzai-Bot\node_modules.pnpm\[email protected]\node_modules\jsdom\lib\jsdom\living\nodes\Document-impl.js:95:12)
0|Yunzai-Bot | at ReadStream.wrappedEnqueued (D:\工具\bot\Yunzai-Bot\node_modules.pnpm\[email protected]\node_modules\jsdom\lib\jsdom\browser\resource-loader.js:253:16)
0|Yunzai-Bot | at ReadStream.emit (node:events:513:28)
0|Yunzai-Bot | at emitErrorNT (node:internal/streams/destroy:151:8)
0|Yunzai-Bot | at emitErrorCloseNT (node:internal/streams/destroy:116:3)
0|Yunzai-Bot | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) [Error: ENOENT: no such file or directory, open 'D:%E5%B7%A5%E5%85%B7\bot\Yunzai-Bot\node_modules.pnpm\[email protected]\node_modules\mathjax\unpacked\MathJax.js'] {
0|Yunzai-Bot | errno: -4058,
0|Yunzai-Bot | code: 'ENOENT',
0|Yunzai-Bot | syscall: 'open',
0|Yunzai-Bot | path: 'D:\%E5%B7%A5%E5%85%B7\bot\Yunzai-Bot\node_modules\.pnpm\[email protected]\node_modules\mathjax\unpacked\MathJax.js'

发送信息提示
OpenAI认证失败,请检查Token:Error: ChatGPT failed to refresh auth token. Error: 403 Forbidden
重新获取token没有用

可否加入调整bot触发方式的功能

现在bot只能以群聊@或者私聊直接发送的方式触发,这导致云崽的自定义表情和一些插件的触发短语必须加上井号才能使用,很不方便。
后续可否调整相关功能,比如在发送的内容前面加上特定的短语或者符号才会触发chatgpt。这样就不用给自定义表情等加上井号了。

使用v2版本,使用chromePath空值后启动失败

chromePath: ''

//然后

0|Yunzai-Bot | [YzBot][23:06:16.764][MARK] puppeteer Chromium 启动中...
0|Yunzai-Bot | [YzBot][23:06:16.811][ERRO] Error: An executablePath or channel must be specified for puppeteer-core
0|Yunzai-Bot | [YzBot][23:06:16.812][ERRO] puppeteer Chromium 启动失败
0|Yunzai-Bot | Error: Failed to launch the browser process! spawn /Applications/Google Chrome.app/Contents/MacOS/Google Chrome ENOENT
0|Yunzai-Bot | TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
0|Yunzai-Bot | at onClose (/root/Yunzai-Bot/node_modules/.pnpm/[email protected]/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:299:20)
0|Yunzai-Bot | at ChildProcess. (/root/Yunzai-Bot/node_modules/.pnpm/[email protected]/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:293:24)
0|Yunzai-Bot | at ChildProcess.emit (node:events:513:28)
0|Yunzai-Bot | at ChildProcess._handle.onexit (node:internal/child_process:289:12)
0|Yunzai-Bot | at onErrorNT (node:internal/child_process:476:16)
0|Yunzai-Bot | at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
0|Yunzai-Bot | [YzBot][23:06:16.827][ERRO] [chatgpt][chatgpt]
0|Yunzai-Bot | [YzBot][23:06:16.828][ERRO] Error: Failed to launch the browser process! spawn /Applications/Google Chrome.app/Contents/MacOS/Google Chrome ENOENT
0|Yunzai-Bot | TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
0|Yunzai-Bot | at onClose (/root/Yunzai-Bot/node_modules/.pnpm/[email protected]/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:299:20)
0|Yunzai-Bot | at ChildProcess. (/root/Yunzai-Bot/node_modules/.pnpm/[email protected]/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:293:24)
0|Yunzai-Bot | at ChildProcess.emit (node:events:513:28)
0|Yunzai-Bot | at ChildProcess._handle.onexit (node:internal/child_process:289:12)
0|Yunzai-Bot | at onErrorNT (node:internal/child_process:476:16)
0|Yunzai-Bot | at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

请问这个是什么问题

加载插件报错

载入插件错误:chatgpt
[ERRO] SyntaxError: Unexpected token '.'
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:475:14)
at async link (node:internal/modules/esm/module_job:67:21)
请问下出现这个错误怎么解决呢?谢谢

关于代码发送到QQ

感觉chatgdt发送代码到QQ可以转成图片再发送给chatgdt,类似nonebot的商店那个chatgpt一样

使用index_no#.js时的TypeError问题

我在使用直接@机器人就会触发的index_no#.js时遇到了如下情况:
在正常未触发机器人的聊天过程中,发送单独一张图片时,会出现如下报错:
image

刚截取的token无效

我重启机器人总是显示加载错误:
[YzBot][07:07:28.800][ERRO] Error: ChatGPT invalid clearance token
at new ChatGPTAPI (file:///D:/Bot/Yunzai-Bot/node_modules/.pnpm/[email protected][email protected]/node_modules/chatgpt/build/index.js:157:13)
at new chatgpt (file:///D:/Bot/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js:77:23)
at file:///D:/Bot/Yunzai-Bot/lib/plugins/loader.js:59:24
at D:\Bot\Yunzai-Bot\node_modules.pnpm\[email protected]\node_modules\lodash\lodash.js:4967:15
at baseForOwn (D:\Bot\Yunzai-Bot\node_modules.pnpm\[email protected]\node_modules\lodash\lodash.js:3032:24)
at D:\Bot\Yunzai-Bot\node_modules.pnpm\[email protected]\node_modules\lodash\lodash.js:4936:18
at Function.forEach (D:\Bot\Yunzai-Bot\node_modules.pnpm\[email protected]\node_modules\lodash\lodash.js:9410:14)
at PluginsLoader.load (file:///D:/Bot/Yunzai-Bot/lib/plugins/loader.js:53:16)
at async onlineEvent.execute (file:///D:/Bot/Yunzai-Bot/lib/events/online.js:23:5)

但是我是在同一个ip下复制token到index文件里的,应该不存在异地登陆等问题。很奇怪,它又告知通关Token无效。

关于能否添加proxy服务器的设置

J PIM1Y9U504}R@8UUGIJT
在ChatGPTAPI中没有发现代理服务器的相关参数设置

TU~2TQ1(C5937Q0TPFOO@~P
包里面手动加了代理设置也没有效果

开全局代理能用但是又会影响到其他模块的功能
能否有办法添加一个proxy的单独设置

载入插件错误:chat

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'puppeteer-extra-plugin-stealth' imported from C:\Users\Administrator\Desktop\Yunzai-Bot\plugins\chatgpt-plugin\utils\browser.js
0|Yunzai-Bot | Did you mean to import [email protected][email protected]/node_modules/puppeteer-extra-plugin-stealth/index.js?
0|Yunzai-Bot | at new NodeError (node:internal/errors:387:5)
0|Yunzai-Bot | at packageResolve (node:internal/modules/esm/resolve:951:9)
0|Yunzai-Bot | at moduleResolve (node:internal/modules/esm/resolve:1000:20)
0|Yunzai-Bot | at defaultResolve (node:internal/modules/esm/resolve:1214:11)
0|Yunzai-Bot | at nextResolve (node:internal/modules/esm/loader:165:28)
0|Yunzai-Bot | at ESMLoader.resolve (node:internal/modules/esm/loader:844:30)
0|Yunzai-Bot | at ESMLoader.getModuleJob (node:internal/modules/esm/loader:431:18)
0|Yunzai-Bot | at ModuleWrap. (node:internal/modules/esm/module_job:76:40)
0|Yunzai-Bot | at link (node:internal/modules/esm/module_job:75:36) {
0|Yunzai-Bot | code: 'ERR_MODULE_NOT_FOUND'
0|Yunzai-Bot | }

插件载入错误, Cannot find package ' puppeteer-extra-plugin-stealth'

试图用pnpm install puppeteer-extra-plugin-stealth 不行_(:з)∠)_,求助一下解决办法。node版本是18以上的。

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '
puppeteer-extra-plugin-stealth' imported from E:\yuanshen\Yunzai-Bot\plugins\ch
atgpt-plugin\utils\browser.js
at new NodeError (node:internal/errors:393:5)
at packageResolve (node:internal/modules/esm/resolve:860:9)
at moduleResolve (node:internal/modules/esm/resolve:909:20)
at defaultResolve (node:internal/modules/esm/resolve:1124:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap. (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND'
}

关于代码等输出不全、无法联系上下文等问题

发现有时让bot写代码会出现输出不全、不能理解上下文语境等情况,起初以为是qq官方的字数限制,后来发现是ooenai官方api的特性,单次输出不完整时,可通过Continue指令让ai继续接着上一句说。
但由于chatgpt模型发布时间较短,各个第三方api库明显存在一些不完善之处,比如本项目使用的nodejs库chatgpt-api对conversation的支持就不够好,导致官网支持的Continue指令在这里无法识别。
目前看到上游已有多位大佬指出该问题并进行了修改和pr,待作者确认合并后这边将第一时间跟进更新。

载入插件错误报错 Error: ENOENT: no such file or directory, scandir './plugins/chatgpt-plugin/apps'

日志如下:

[YzBot][17:02:57.593][INFO] 加载插件中..
[YzBot][17:02:57.608][ERRO] 载入插件错误:chatgpt
[YzBot][17:02:57.608][ERRO] Error: ENOENT: no such file or directory, scandir './plugins/chatgpt-plugin/apps'
    at Object.readdirSync (node:fs:1451:3)
    at file:///root/chat-gpt-qq/Yunzai-Bot/plugins/chatgpt/index.js:3:18
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async PluginsLoader.load (file:///root/chat-gpt-qq/Yunzai-Bot/lib/plugins/loader.js:50:19)
    at async onlineEvent.execute (file:///root/chat-gpt-qq/Yunzai-Bot/lib/events/online.js:23:5)

用自动登录的那个版本报错,加载失败...

[YzBot][01:57:15.630][INFO] 加载插件中..
[YzBot][01:57:15.667][ERRO] 载入插件错误:chat
[YzBot][01:57:15.668][ERRO] Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'puppeteer-extra-plugin-stealth' imported from D:\BOT\Yunzai-Bot\plugins\chatgpt-plugin\utils\autoLogin.js
at new NodeError (node:internal/errors:393:5)
at packageResolve (node:internal/modules/esm/resolve:823:9)
at moduleResolve (node:internal/modules/esm/resolve:872:20)
at defaultResolve (node:internal/modules/esm/resolve:1087:11)
at nextResolve (node:internal/modules/esm/loader:161:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:831:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:413:18)
at ModuleWrap. (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36) {
code: 'ERR_MODULE_NOT_FOUND'
}

关于token更新问题

现在我的Chatgpt聊天页面每隔几十秒就会更新一次token,请问这是该站的新策略还是我这边的问题,如果是我的问题请问应如何获取到有效的token。

自动登录的版本装好puppeteer之后报错puppeteer Chromium 启动失败与,有点懵...

[YzBot][13:12:26.747][MARK] puppeteer Chromium 启动中...
[YzBot][13:12:26.749][ERRO] Error: An executablePath or channel must be specified for puppeteer-core
[YzBot][13:12:26.750][ERRO] puppeteer Chromium 启动失败
[YzBot][13:12:26.750][ERRO] TypeError: Cannot read properties of undefined (reading 'newPage')
at ChatGPTPuppeteer.login (file:///D:/BOT/Yunzai-Bot/plugins/chatgpt-plugin/utils/autoLogin.js:101:39)
at async chatgpt (file:///D:/BOT/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js:208:5)
at async PluginsLoader.deal (file:///D:/BOT/Yunzai-Bot/lib/plugins/loader.js:251:52)
[YzBot][13:12:26.750][ERRO] [chatgpt][chatgpt]
[YzBot][13:12:26.750][ERRO] TypeError: Cannot read properties of undefined (reading 'close')
at ChatGPTPuppeteer.login (file:///D:/BOT/Yunzai-Bot/plugins/chatgpt-plugin/utils/autoLogin.js:196:20)
at async chatgpt (file:///D:/BOT/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js:208:5)
at async PluginsLoader.deal (file:///D:/BOT/Yunzai-Bot/lib/plugins/loader.js:251:52)

请问这个puppeteer启动失败如何解决

0|Yunzai-Bot | [YzBot][22:31:26.049][ERRO] puppeteer Chromium 启动失败
0|Yunzai-Bot | [YzBot][22:31:26.050][ERRO] TypeError: Cannot read properties of undefined (reading 'newPage')
0|Yunzai-Bot | at ChatGPTPuppeteer.login (file:///root/Yunzai-Bot/plugins/chatgpt-plugin/utils/autoLogin.js:101:39)
0|Yunzai-Bot | at async chatgpt (file:///root/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js:208:5)
0|Yunzai-Bot | at async PluginsLoader.deal (file:///root/Yunzai-Bot/lib/plugins/loader.js:251:52)
0|Yunzai-Bot | [YzBot][22:31:26.051][ERRO] [chatgpt][chatgpt]
0|Yunzai-Bot | [YzBot][22:31:26.052][ERRO] TypeError: Cannot read properties of undefined (reading 'close')
0|Yunzai-Bot | at ChatGPTPuppeteer.login (file:///root/Yunzai-Bot/plugins/chatgpt-plugin/utils/autoLogin.js:196:20)
0|Yunzai-Bot | at async chatgpt (file:///root/Yunzai-Bot/plugins/chatgpt-plugin/apps/chat.js:208:5)
0|Yunzai-Bot | at async PluginsLoader.deal (file:///root/Yunzai-Bot/lib/plugins/loader.js:251:52)

报错Unauthorized

完整报错,请问是什么没有授权
Error: ChatGPT failed to refresh auth token. Error:
Unauthorized
at ChatGPTAPI.refreshAccessToken (file:///G:/redis-windows-7.0.4/Yunzai-Bot/
node_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:259:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ChatGPTAPI.ensureAuth (file:///G:/redis-windows-7.0.4/Yunzai-Bot/no
de_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:225:12)
at async chatgpt (file:///G:/redis-windows-7.0.4/Yunzai-Bot/plugins/chatgpt/
index.js:117:5)
at async PluginsLoader.deal (file:///G:/redis-windows-7.0.4/Yunzai-Bot/lib/p
lugins/loader.js:251:52)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.