Code Monkey home page Code Monkey logo

chatgpt-wechat-bot's Introduction

Profile Viewer

My email is: [email protected]

QQ微信同号: 439661734, Telegram: @Jin_1001

Welcome to contact me about any tech Q/A!

chatgpt-wechat-bot's People

Contributors

autumnwhj avatar codepythonfollow avatar harrozze avatar ntlm1686 avatar shfshanyue avatar snapdragonlee avatar sumanpaikdev 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  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

chatgpt-wechat-bot's Issues

请问怎么在微信使用chatGPT聊天机器人

按照教程能够正常在iterm2终端正常登陆,但是手机上看不到chatGPT的聊天机器人,在iterm2里输入消息回车也没有任何反应,一定是我打开的方式不对,请指教🙏🏻

ChatGPT和基于ChatGPT的微信机器人

ChatGPT为啥爆火?

先看看ChatGPT的热度。这几天不管是微信公众号还是各大内容网站都充斥着ChatGPT的消息,什么毁灭人类、让程序员下岗、在线创造等等都非常博人眼球,那作为程序员的我们自然要“首当其冲”去体验一把,是骡子是马,拉出来溜溜就知道了。
image.png

什么是ChatGPT

有了GPT-3.5的加持,ChatGPT经训练后提升了对答如流的能力。GPT-3只预测任何给定的单词串之后的文本,而ChatGPT则试图以一种更像人类的方式与用户发生互动。ChatGPT的互动通常是非常流畅的,并且有能力参与各种主题,与几年前才面世的聊天机器人相比,显示出了巨大的改进。

怎么体验ChatGPT

注册ChatGPT前先要注册OpenAI的账号,但是因为它暂时并不对咱们国家开放注册,因此是需要一些科学的手段才能注册得上,下面👇🏻分享注册的方法。嫌麻烦的朋友

方式一:ChatGPT网站注册(需科学上网)

由于爆火,它的网站https://chat.openai.com/chat甚至于崩了~~
image.png
步骤如下:

  1. 科学上网的代理开启全局模式

  2. 进入ChatGPT的网站,点击sign up进行OpenAI账号的注册

    image.png

  3. 注册成功会要求手机号验证,China的手机号是不支持的,这时候需要去购买个虚拟手机号,步骤如下

    1. 进入sms-activate的网站,首先注册账号,然后搜索OpenAI相关的服务,点击后选择便宜的购买(需花费人民币1块多)。

image (7).png

image (6).png

  1. 充值就刚好够用就行image.png

  2. 充值后购买,就会提供一个虚拟号码给你使用,复制这个号码到OpenAI进去手机的验证即可(

  3. 验证完手机后,再进入ChatGPT的网站,登录成功后即可体验!!!

    image.png
    注意📢:

  • 虚拟手机号接收短信可能延迟,需要等待一会,或者在OpenAI验证手机号码的网页下,resend重新发送验证码。如果多次收不到,根据个人财务情况,可以再购买多一个虚拟号码试试。

  • 记得开全局代理,并且最后打开无痕浏览器,否则你会看到以下页面

    ![image.png](https://cdn.nlark.com/yuque/0/2022/png/2777249/1670257459023-336b4c13-dfc2-4204-9f5c-88a693acbeaf.png#averageHue=%23353641&clientId=ue76580c6-c158-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=202&id=uc8c691bc&margin=%5Bobject%20Object%5D&name=image.png&originHeight=596&originWidth=1048&originalType=binary&ratio=1&rotation=0&showTitle=false&size=48262&status=done&style=none&taskId=uec4ab4c2-c511-4968-b951-026231f6f99&title=&width=356)
    

完成以上步骤就可以体验ChatGPT了。

方式二:加微信机器人🤖

直接加微信机器人:chatgpt_001 ,输入验证消息chat或者chatgpt,通过验证后,发送信息等待ChatGPT的回复即可(ChatGPT回复的内容是markdown格式的,且微信消息会掉其中一些文本进行过滤。)
正如媒体宣传的那样,ChatGPT作为小助手确实好使的,为了方便使用(主要在网页使用要开代理~),因此开发了一个微信机器人🤖,直接向小助手发送消息,然后等待回复就可以啦~
image.png
获取以下源码,这样你也可以自定义自己的小助手了(star⭐️,支持一下)。
https://github.com/AutumnWhj/ChatGPT-wechat-bot

推荐

一键配置前端项目规范(ESLin, Prettier, Stylelint, Commitlint config,Husky, lint-stage)

大佬们知道这个错误怎么解决吗?在云服务器上跑的。

file:///C:/Users/Administrator/Desktop/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-service/dist/esm/src/client/puppet-service.js:1148
timestamp ??= 0;
^^^

SyntaxError: Unexpected token '??='
at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: npm run build && node lib/bundle.esm.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\nodejs\node_cache_logs\2022-12-08T05_22_40_998Z-debug.log

微信群组中要如何使用?

如题,我刚使用你的仓库成功搭建起来了,私聊对话验证过了,可以正常试用,但是群聊消息中不会回复任何信息,即使@bot也没用,后台log能看到收到消息。

所以想问问需要怎么操作?

请问怎么激活群里的机器人呢

请问怎么激活群里的机器人呢,设置了关键字唤醒,只有私聊会回复,但群聊提示这个

Group name: 天天学习好好向上 talker: kenvie content: 小爱同学 你好
Content is not within the scope of the customizition format

请问一下这是什么错误21:16:58 ERR PuppetWeChatBridge start() exception: Error: An `executablePath` ...

./src/index.ts → lib/bundle.esm.js...
created lib/bundle.esm.js in 1.9s
21:16:58 ERR PuppetWeChatBridge start() exception: Error: An executablePath or channel must be specified for puppeteer-core
21:16:58 ERR PuppetWeChat initBridge() exception: An executablePath or channel must be specified for puppeteer-core
21:16:58 ERR PuppetWeChat initBridge() this.bridge.stop() rejection: Error: no page
GError: An executablePath or channel must be specified for puppeteer-core
at assert (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\util\assert.js:28:15)
at ChromeLauncher.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\node\ChromeLauncher.js:69:36)
at PuppeteerNode.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\node\PuppeteerNode.js:154:105)
at PuppeteerExtra.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-extra\dist\index.cjs.js:128:41)
at async Bridge.initBrowser (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:109:23)
at async Bridge.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:48:28)
at async PuppetWeChat.initBridge (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat.
js:176:13)
at async PuppetWeChat.onStart (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat.js:
69:23)
at async PuppetWeChat.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/state-switch/dist/esm/src/service-ctl/service-ctl.js:6
2:17)
at async PuppetWeChat.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/mixins/service-mixin.js:18
:13) {
code: 2,
details: 'Error: An executablePath or channel must be specified for puppeteer-core\n' +
' at assert (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\util\assert.js:28:15)\n' +
' at ChromeLauncher.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\node\ChromeLaunc
her.js:69:36)\n' +
' at PuppeteerNode.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-core\lib\cjs\puppeteer\node\PuppeteerNod
e.js:154:105)\n' +
' at PuppeteerExtra.launch (D:\22370\Code\Web\ChatGPT-wechat-bot\node_modules\puppeteer-extra\dist\index.cjs.js:128:41)\n' +
' at async Bridge.initBrowser (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:109:
23)\n' +
' at async Bridge.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:48:28)\n'
+
' at async PuppetWeChat.initBridge (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-we
chat.js:176:13)\n' +
' at async PuppetWeChat.onStart (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wecha
t.js:69:23)\n' +
' at async PuppetWeChat.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/state-switch/dist/esm/src/service-ctl/service-ctl
.js:62:17)\n' +
' at async PuppetWeChat.start (file:///D:/22370/Code/Web/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/mixins/service-mixin.
js:18:13)'
}

api疑似不能使用?

1|bundle.esm | Error: ChatGPTAPI error 503
1|bundle.esm | at fetchSSE (file:///home/admin/ChatGPT-wechat-bot/node_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:70:11)
1|bundle.esm | at processTicksAndRejections (node:internal/process/task_queues:96:5)

我使用pm2后台运行,突然不会回复了,终端显示上述内容

这个错误咋解决

22:49:08 ERR PuppetWeChatBridge start() exception: Error: An executablePath or channel must be specified for puppeteer-core
22:49:08 ERR PuppetWeChat initBridge() exception: An executablePath or channel must be specified for puppeteer-core
22:49:08 ERR PuppetWeChat initBridge() this.bridge.stop() rejection: Error: no page
GError: An executablePath or channel must be specified for puppeteer-core
at assert (E:\机器人\ChatGPT-wechat-bot-master\ChatGPT-wechat-bot-master\node_modules\puppeteer-core\lib\cjs\puppeteer\util\assert.js:28:15)
at ChromeLauncher.launch (E:\机器人\ChatGPT-wechat-bot-master\ChatGPT-wechat-bot-master\node_modules\puppeteer-core\lib\cjs\puppeteer\node\ChromeLauncher.js:69:36)
at PuppeteerNode.launch (E:\机器人\ChatGPT-wechat-bot-master\ChatGPT-wechat-bot-master\node_modules\puppeteer-core\lib\cjs\puppeteer\node\PuppeteerNode.js:154:105)
at PuppeteerExtra.launch (E:\机器人\ChatGPT-wechat-bot-master\ChatGPT-wechat-bot-master\node_modules\puppeteer-extra\dist\index.cjs.js:128:41)
at async Bridge.initBrowser (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:109:23)
at async Bridge.start (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:48:28)
at async PuppetWeChat.initBridge (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat.js:176:13)
at async PuppetWeChat.onStart (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat.js:69:23)
at async PuppetWeChat.start (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/state-switch/dist/esm/src/service-ctl/service-ctl.js:62:17)
at async PuppetWeChat.start (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet/dist/esm/src/mixins/service-mixin.js:18:13) {
code: 2,
details: 'Error: An executablePath or channel must be specified for puppeteer-core\n' +
' at assert (E:\机器人\ChatGPT-wechat-bot-master\ChatGPT-wechat-bot-master\node_modules\puppeteer-core\lib\cjs\puppeteer\util\assert.js:28:15)\n' +
' at ChromeLauncher.launch (E:\机器人\ChatGPT-wechat-bot-master\ChatGPT-wechat-bot-master\node_modules\puppeteer-core\lib\cjs\puppeteer\node\ChromeLauncher.js:69:36)\n' +
' at PuppeteerNode.launch (E:\机器人\ChatGPT-wechat-bot-master\ChatGPT-wechat-bot-master\node_modules\puppeteer-core\lib\cjs\puppeteer\node\PuppeteerNode.js:154:105)\n' +
' at PuppeteerExtra.launch (E:\机器人\ChatGPT-wechat-bot-master\ChatGPT-wechat-bot-master\node_modules\puppeteer-extra\dist\index.cjs.js:128:41)\n' +
' at async Bridge.initBrowser (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:109:23)\n' +
' at async Bridge.start (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:48:28)\n' +
' at async PuppetWeChat.initBridge (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat.js:176:13)\n' +
' at async PuppetWeChat.onStart (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat.js:69:23)\n' +
' at async PuppetWeChat.start (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/state-switch/dist/esm/src/service-ctl/service-ctl.js:62:17)\n' +
' at async PuppetWeChat.start (file:///E:/%E6%9C%BA%E5%99%A8%E4%BA%BA/ChatGPT-wechat-bot-master/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet/dist/esm/src/mixins/service-mixin.js:18:13)'
}

进程已结束,退出代码0

这这个报错怎么办

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

at onClose (/root/ChatGPT-wechat-bot/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:241:20)
at Interface.<anonymous> (/root/ChatGPT-wechat-bot/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:231:68)
at Interface.emit (node:events:406:35)
at Interface.close (node:readline:586:8)
at Socket.onend (node:readline:277:10)
at Socket.emit (node:events:406:35)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {

code: 2,
details: 'Error: Failed to launch the browser process!\n' +
'/root/ChatGPT-wechat-bot/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome: error while loading shared libraries: libatk-bridge-2.0.so.0: cannot open shared object file: No such file or directory\n' +
'\n' +
'\n' +
'TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md\n' +
'\n' +
' at onClose (/root/ChatGPT-wechat-bot/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:241:20)\n' +
' at Interface. (/root/ChatGPT-wechat-bot/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:231:68)\n' +
' at Interface.emit (node:events:406:35)\n' +
' at Interface.close (node:readline:586:8)\n' +
' at Socket.onend (node:readline:277:10)\n' +
' at Socket.emit (node:events:406:35)\n' +
' at endReadableNT (node:internal/streams/readable:1343:12)\n' +
' at processTicksAndRejections (node:internal/process/task_queues:83:21)'

登录微信超时,有人遇到这个问题吗?

details: 'Error: WatchdogAgent reset: lastFood: "{"data":{"code":201,"url":"xxx"},"timeoutMilliseconds":60000}"\n' +
' at Watchdog.reset (file:///xxx/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/agents/watchdog-agent.js:45:39)\n' +
' at Watchdog.emit (node:events:390:28)\n' +
' at Timeout._onTimeout (file:///xxx/ChatGPT-wechat-bot/node_modules/watchdog/dist/esm/src/watchdog.js:81:18)\n' +
' at listOnTimeout (node:internal/timers:557:17)\n' +
' at processTimers (node:internal/timers:500:7)'

关于登录问题

对WeChat的要求,是否必须能够登录WeChat网页版的账号才可以登录到程序中

启动不起来

./src/index.ts → lib/bundle.esm.js...
created lib/bundle.esm.js in 1.6s
file:///Users/lzx/work/IT/workspace/WebstormProjects/ChatGPT-wechat-bot-master/node_modules/.pnpm/[email protected]_jkyvhh2danr4dcnhzsykeo22pa/node_modules/wechaty-puppet-service/dist/esm/src/client/puppet-service.js:1148
timestamp ??= 0;
^^^

SyntaxError: Unexpected token '??='
at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
 ELIFECYCLE  Command failed with exit code 1.

报错

微信接收消息报错

我在本地控制到npm run dev 启动,扫码登录微信以后,接收到别人的消息就会报错:
Error: ChatGPT failed to refresh auth token. TypeError: _undici.fetch is not a function
at ChatGPTAPI.refreshAccessToken (file:///Users/zz/openAI/ChatGPT-wechat-bot-master/node_modules/chatgpt/build/index.js:246:13)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async ChatGPTAPI.ensureAuth (file:///Users/zz/openAI/ChatGPT-wechat-bot-master/node_modules/chatgpt/build/index.js:212:12)
at async getChatGPTReply (file:///Users/zz/openAI/ChatGPT-wechat-bot-master/lib/bundle.esm.js:14:5)
at async replyMessage (file:///Users/zz/openAI/ChatGPT-wechat-bot-master/lib/bundle.esm.js:29:23)

Error: ChatGPT failed to refresh auth token. Error: 403 Forbidden

Error: ChatGPT failed to refresh auth token. Error: 403 Forbidden
    at ChatGPTAPI.refreshAccessToken (file:///code/node_modules/chatgpt/build/index.js:246:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ChatGPTAPI.ensureAuth (file:///code/node_modules/chatgpt/build/index.js:212:12)
    at async getChatGPTReply (file:///code/lib/bundle.esm.js:14:5)
    at async replyMessage (file:///code/lib/bundle.esm.js:29:23)

说是无法刷新token,时灵时不灵

node lib/bundle.esm.js with error

你好,安装教程执行下来后,启动报错。

[root@centos ChatGPT-wechat-bot]# node lib/bundle.esm.js
file:///root/apps/ChatGPT-wechat-bot/node_modules/wechaty-puppet-service/dist/esm/src/client/puppet-service.js:1148
        timestamp ??= 0;
                  ^^^

SyntaxError: Unexpected token '??='

这是什么错误

36:05 WARN PuppetWatchdogAgent start() reset() reason: {"data":"heartbeat@browserbridge ding","timeoutMilliseconds":60000}
node:events:371
throw er; // Unhandled 'error' event
^

GError: WatchdogAgent reset: lastFood: "{"data":"heartbeat@browserbridge ding","timeoutMilliseconds":60000}"
at Watchdog.reset (file:///root/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/agents/watchdog-agent.js:45:39)
at Watchdog.emit (node:events:394:28)
at Timeout._onTimeout (file:///root/ChatGPT-wechat-bot/node_modules/watchdog/dist/esm/src/watchdog.js:81:18)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)
Emitted 'error' event on WechatyImpl instance at:
at WechatyImpl.emit (file:///root/ChatGPT-wechat-bot/node_modules/wechaty/dist/esm/src/wechaty-mixins/gerror-mixin.js:45:26)
at PuppetWeChat. (file:///root/ChatGPT-wechat-bot/node_modules/wechaty/dist/esm/src/wechaty-mixins/puppet-mixin.js:155:34)
at PuppetWeChat.emit (node:events:394:28)
at PuppetWeChat.emit (file:///root/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/puppet/puppet-skeleton.js:107:22)
at Watchdog.reset (file:///root/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/agents/watchdog-agent.js:45:25)
at Watchdog.emit (node:events:394:28)
[... lines matching original stack trace ...]
at processTimers (node:internal/timers:500:7) {
code: 2,
details: 'Error: WatchdogAgent reset: lastFood: "{"data":"heartbeat@browserbridge ding","timeoutMilliseconds":60000}"\n' +
' at Watchdog.reset (file:///root/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/agents/watchdog-agent.js:45:39)\n' +
' at Watchdog.emit (node:events:394:28)\n' +
' at Timeout._onTimeout (file:///root/ChatGPT-wechat-bot/node_modules/watchdog/dist/esm/src/watchdog.js:81:18)\n' +
' at listOnTimeout (node:internal/timers:557:17)\n' +
' at processTimers (node:internal/timers:500:7)'
}

这个错误怎么解决

Error: ChatGPTAPI error 503
at fetchSSE (file:///root/ChatGPT-wechat-bot/node_modules/chatgpt/build/index.js:75:11)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
02:02:48 WARN PuppetWatchdogAgent start() reset() reason: {"data":"heartbeat@browserbridge ding","timeoutMilliseconds":60000}
node:events:371
throw er; // Unhandled 'error' event
^

GError: WatchdogAgent reset: lastFood: "{"data":"heartbeat@browserbridge ding","timeoutMilliseconds":60000}"
at Watchdog.reset (file:///root/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/agents/watchdog-agent.js:45:39)
at Watchdog.emit (node:events:394:28)
at Timeout._onTimeout (file:///root/ChatGPT-wechat-bot/node_modules/watchdog/dist/esm/src/watchdog.js:81:18)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)
Emitted 'error' event on WechatyImpl instance at:
at WechatyImpl.emit (file:///root/ChatGPT-wechat-bot/node_modules/wechaty/dist/esm/src/wechaty-mixins/gerror-mixin.js:45:26)
at PuppetWeChat. (file:///root/ChatGPT-wechat-bot/node_modules/wechaty/dist/esm/src/wechaty-mixins/puppet-mixin.js:155:34)
at PuppetWeChat.emit (node:events:394:28)
at PuppetWeChat.emit (file:///root/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/puppet/puppet-skeleton.js:107:22)
at Watchdog.reset (file:///root/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/agents/watchdog-agent.js:45:25)
at Watchdog.emit (node:events:394:28)
[... lines matching original stack trace ...]
at processTimers (node:internal/timers:500:7) {
code: 2,
details: 'Error: WatchdogAgent reset: lastFood: "{"data":"heartbeat@browserbridge ding","timeoutMilliseconds":60000}"\n' +
' at Watchdog.reset (file:///root/ChatGPT-wechat-bot/node_modules/wechaty-puppet/dist/esm/src/agents/watchdog-agent.js:45:39)\n' +
' at Watchdog.emit (node:events:394:28)\n' +
' at Timeout._onTimeout (file:///root/ChatGPT-wechat-bot/node_modules/watchdog/dist/esm/src/watchdog.js:81:18)\n' +
' at listOnTimeout (node:internal/timers:557:17)\n' +
' at processTimers (node:internal/timers:500:7)'
}

微信发消息

image

这里说的发消息是怎么发呀,需要添加账户吗?还是通过什么方式?

求教使用方法

是运行起来之后,拿自己微信扫码吗?我扫描之后微信说“当前账号无法使用该服务”。是需要为bot专门注册个机器人号吗?谢谢

built docker和在index中填入token是否有先后顺序


built docker, token填入index, 运行docker
built docker, 运行docker, token填入index
两种顺序执行,扫码登录,接受到微信消息后都显示如下错误 该如何解决.

Error: ChatGPT invalid session token
at new ChatGPTAPI (file:///code/node_modules/chatgpt/build/index.js:110:13)
at getChatGPTReply (file:///code/lib/bundle.esm.js:12:17)
at replyMessage (file:///code/lib/bundle.esm.js:29:29)
at WechatyImpl.onMessage (file:///code/lib/bundle.esm.js:58:17)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

希望增加ARM 服务器编译

Step 4/8 : RUN npm i && npm run puppet-install
---> Running in b2b515e31297
npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: < 18.1.0 is no longer supported
npm notice
npm notice New major version of npm available! 8.19.2 -> 9.2.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.2.0
npm notice Run npm install -g [email protected] to update!
npm notice
npm ERR! code 1
npm ERR! path /code/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c -- node install.js
npm ERR! The chromium binary is not available for arm64.
npm ERR! If you are on Ubuntu, you can install with:
npm ERR!
npm ERR! sudo apt install chromium
npm ERR!
npm ERR!
npm ERR! sudo apt install chromium-browser
npm ERR!
npm ERR! /code/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:119
npm ERR! throw new Error();
npm ERR! ^
npm ERR!
npm ERR! Error
npm ERR! at /code/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:119:27
npm ERR! at FSReqCallback.oncomplete (node:fs:202:21)

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-12-10T09_11_44_972Z-debug-0.log
The command '/bin/sh -c npm i && npm run puppet-install' returned a non-zero code: 1

无法刷新authtoken

talker: Hypocrite content: 你好
Error: ChatGPT failed to refresh auth token. TypeError: Cannot convert argument to a ByteString because the character at index 1032 has a value of 8230 which is greater than 255.
at ChatGPTAPI.refreshAccessToken (file:///root/ChatGPT-wechat-bot/node_modules/chatgpt/build/index.js:246:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ChatGPTAPI.ensureAuth (file:///root/ChatGPT-wechat-bot/node_modules/chatgpt/build/index.js:212:12)
at async getChatGPTReply (file:///root/ChatGPT-wechat-bot/lib/bundle.esm.js:14:5)
at async replyMessage (file:///root/ChatGPT-wechat-bot/lib/bundle.esm.js:29:23)

dockerfile

你好我问一下那个dockerfile里应该写什么啊,它提示我dockerfile是空的

build不出来

docker build --pull --rm -f "Dockerfile" -t wechatbot:latest "." --platform linux/amd64
运行这个build的命令一直卡着不动,是需要服务器能访问国外网络?

请问这是什么问题

file:///C:/Users/tt/Desktop/ChatGPT-wechat-bot-master/node_modules/chatgpt/build/index.js:70
throw new Error(ChatGPTAPI error ${res.status || res.statusText});
^

Error: ChatGPTAPI error 503
at fetchSSE (file:///C:/Users/tt/Desktop/ChatGPT-wechat-bot-master/node_modules/chatgpt/build/index.js:70:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

When running the " node lib/bundle.esm.js " command, an error occurred.

 ~/ChatGPT-wechat-bot-master ▓▒░───────────────────░▒▓ at 14:54:50  ─╮
❯ node lib/bundle.esm.js ─╯
14:54:56 ERR PuppetWeChatBridge start() exception: Error: net::ERR_EMPTY_RESPONSE at https://wx.qq.com?lang=zh_CN&target=t
14:54:56 ERR PuppetWeChat initBridge() exception: net::ERR_EMPTY_RESPONSE at https://wx.qq.com?lang=zh_CN&target=t
14:54:56 WARN PuppetWeChatBridge stop() page.close() exception: Error: Protocol error: Connection closed. Most likely the page has been closed.
GError: net::ERR_EMPTY_RESPONSE at https://wx.qq.com?lang=zh_CN&target=t
at navigate (/home/gz/ChatGPT-wechat-bot-master/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:156:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async FrameManager.navigateFrame (/home/gz/ChatGPT-wechat-bot-master/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:131:21)
at async Frame.goto (/home/gz/ChatGPT-wechat-bot-master/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:512:16)
at async Page.goto (/home/gz/ChatGPT-wechat-bot-master/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:1167:16)
at async Bridge.initPage (file:///home/gz/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:181:9)
at async Bridge.start (file:///home/gz/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:52:25)
at async PuppetWeChat.initBridge (file:///home/gz/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat.js:176:13)
at async PuppetWeChat.onStart (file:///home/gz/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat.js:69:23)
at async PuppetWeChat.start (file:///home/gz/ChatGPT-wechat-bot-master/node_modules/state-switch/dist/esm/src/service-ctl/service-ctl.js:62:17) {
code: 2,
details: 'Error: net::ERR_EMPTY_RESPONSE at https://wx.qq.com?lang=zh_CN&target=t\n' +
' at navigate (/home/gz/ChatGPT-wechat-bot-master/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:156:23)\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
' at async FrameManager.navigateFrame (/home/gz/ChatGPT-wechat-bot-master/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:131:21)\n' +
' at async Frame.goto (/home/gz/ChatGPT-wechat-bot-master/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:512:16)\n' +
' at async Page.goto (/home/gz/ChatGPT-wechat-bot-master/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:1167:16)\n' +
' at async Bridge.initPage (file:///home/gz/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:181:9)\n' +
' at async Bridge.start (file:///home/gz/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/bridge.js:52:25)\n' +
' at async PuppetWeChat.initBridge (file:///home/gz/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat.js:176:13)\n' +
' at async PuppetWeChat.onStart (file:///home/gz/ChatGPT-wechat-bot-master/node_modules/wechaty-puppet-wechat/dist/esm/src/puppet-wechat.js:69:23)\n' +
' at async PuppetWeChat.start (file:///home/gz/ChatGPT-wechat-bot-master/node_modules/state-switch/dist/esm/src/service-ctl/service-ctl.js:62:17)'

求大佬们解答一下这是啥问题😭

C:\Code\ChatGPT-wechat-bot-master>node lib/bundle.esm.js
Start to log in wechat...
Contact has logged in
Current time:Thu Dec 08 2022 14:11:08 GMT+0800 (**标准时间)
Automatic robot chat mode has been activated
talker: Anjou content: hello
(node:8140) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use node --trace-warnings ... to show where the warning was created)
file:///C:/Code/ChatGPT-wechat-bot-master/node_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:246
throw new Error(ChatGPT failed to refresh auth token. ${err.toString()});
^

Error: ChatGPT failed to refresh auth token. TypeError: fetch failed
at ChatGPTAPI.refreshAccessToken (file:///C:/Code/ChatGPT-wechat-bot-master/node_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:246:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ChatGPTAPI.ensureAuth (file:///C:/Code/ChatGPT-wechat-bot-master/node_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:212:12)
at async getChatGPTReply (file:///C:/Code/ChatGPT-wechat-bot-master/lib/bundle.esm.js:14:5)
at async replyMessage (file:///C:/Code/ChatGPT-wechat-bot-master/lib/bundle.esm.js:28:19)

Node.js v18.12.1

Cannot build Docker image

I cannot build docker image from Dockerfile.

=> ERROR [4/7] RUN npm i && npm run puppet-install 9.5s

[4/7] RUN npm i && npm run puppet-install:
#9 2.499 npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
#9 3.161 npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
#9 3.634 npm WARN deprecated [email protected]: this library is no longer supported
#9 6.034 npm WARN deprecated [email protected]: < 18.1.0 is no longer supported
#9 6.697 npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
#9 9.358 npm notice
#9 9.358 npm notice New major version of npm available! 8.19.2 -> 9.2.0
#9 9.358 npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.2.0
#9 9.358 npm notice Run npm install -g [email protected] to update!
#9 9.358 npm notice
#9 9.359 npm ERR! code 1
#9 9.359 npm ERR! path /code/node_modules/puppeteer
#9 9.360 npm ERR! command failed
#9 9.360 npm ERR! command sh -c -- node install.js
#9 9.360 npm ERR! The chromium binary is not available for arm64.
#9 9.360 npm ERR! If you are on Ubuntu, you can install with:
#9 9.360 npm ERR!
#9 9.360 npm ERR! sudo apt install chromium
#9 9.360 npm ERR!
#9 9.360 npm ERR!
#9 9.360 npm ERR! sudo apt install chromium-browser
#9 9.360 npm ERR!
#9 9.360 npm ERR! /code/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:119
#9 9.360 npm ERR! throw new Error();
#9 9.360 npm ERR! ^
#9 9.360 npm ERR!
#9 9.360 npm ERR! Error
#9 9.360 npm ERR! at /code/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:119:27
#9 9.360 npm ERR! at FSReqCallback.oncomplete (node:fs:202:21)
#9 9.361
#9 9.361 npm ERR! A complete log of this run can be found in:
#9 9.361 npm ERR! /root/.npm/_logs/2022-12-09T15_02_31_004Z-debug-0.log


executor failed running [/bin/sh -c npm i && npm run puppet-install]: exit code: 1

############################################################################################
My docker version is 20.10.21.
Node.JS version is v18.12.1.
NPM version is 8.19.2.

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.