From 392202437f1eb393e3df177f48ead54c32881b15 Mon Sep 17 00:00:00 2001 From: sunshanpeng Date: Sun, 11 Dec 2022 17:43:42 +0800 Subject: [PATCH 1/3] fix: tigger command in room --- src/chatgpt.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chatgpt.ts b/src/chatgpt.ts index 635270e..36c6e2f 100644 --- a/src/chatgpt.ts +++ b/src/chatgpt.ts @@ -274,7 +274,7 @@ export class ChatGPTBot { "" ); // remove more text via - - - - - - - - - - - - - - - - return text; + return text.trim(); } async getGPTMessage(text: string, talkerId: string): Promise { return await this.chatGPTPool.sendMessage(text, talkerId); From 1f0cbc44baa1b3a66517a96e1c79e9bb8c0ec619 Mon Sep 17 00:00:00 2001 From: inannan423 <605031236@qq.com> Date: Sun, 11 Dec 2022 20:06:17 +0800 Subject: [PATCH 2/3] Update the Railway deployment tutorial. --- README.md | 13 +++++++++++-- README_ZH.md | 14 +++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 98ae144..781bec5 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ > Use ChatGPT On Wechat via wechaty English | [中文文档](README_ZH.md) -[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/BHJD6L?referralCode=FaJtD_) +[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/BHJD6L?referralCode=FaJtD_) + +If you don't have a server or want to experience rapid deployment, you can use Railway to do so, see [Usage with Railway](#usage-with-railway). ## 🌟 Feature @@ -148,7 +150,7 @@ Some environment variables need to be configured: - **CHAT_GPT_PASSWORD** : Your OpenAI Account password, *if you have session_token, It's optional*. -- **CHAT_GPT_SESSION_TOKEN** : Your OpenAI Account session_token, *if you have email and password, It's optional*.See above for how to get it. +- **CHAT_GPT_SESSION_TOKEN** : Your OpenAI Account session_token, *if you have email and password, It's optional*.See how to get a token [here](#b-use-session-token). - **CHAT_GPT_RETRY_TIMES** : The number of times to retry when the OpenAI API returns 429 or 503. @@ -168,6 +170,13 @@ Log in successfully and start sending and receiving messages(This process can ta ![railway-success](docs/images/railway-succeed.png) +Besides, in deployment, you may encounter the following issues: + +- **Error: ⚠️ No chatgpt item in pool** : This error means that you have not configured the OpenAI account information correctly. You can solve this problem from the following aspects:1. Check whether the token or openAI account and password are filled in correctly. 2. The token may have expired (experience shows that the expiration time of the token is **24** hours), you can go to the chatGPT official website to re-obtain the token. 3. Redeploy Current Services.Note that the above should be modified on the Variables page in Railway Dashboard. +- **After the deployment is complete, the QR code is not generated**.Try **refreshing** the page to see again if the Deploy Logs panel generated a link and QR code. +- **The generated QR code cannot be scanned**.On the generated QR code, there is a link that can be clicked to scan the QR code. +- **Message feedback is very slow**.Because Rail's servers are deployed overseas, there is an increase in message feedback latency, but it is still within the acceptance range. If you are time sensitive, you can use your own server deployment. + ## Author 👤 **holegots** diff --git a/README_ZH.md b/README_ZH.md index 74ce6f5..cd21fdd 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -9,11 +9,12 @@

- > 在微信上迅速接入 ChatGPT,让它成为你最好的助手! > [English](README.md) | 中文文档 -[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/BHJD6L?referralCode=FaJtD_) +[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/BHJD6L?referralCode=FaJtD_) + +如果你没有自己的服务器或者想体验快速部署,可使用 Railway 进行部署,参见 [Railway 部署](#railway-部署)。 ## 🌟 功能点 @@ -149,7 +150,7 @@ npm run dev - **CHAT_GPT_PASSWORD** :您的 OpenAI 帐户密码,如果您有 session_token,则可不填。 -- **CHAT_GPT_SESSION_TOKEN** :您的 OpenAI 帐户 session_token,如果您有电子邮件和密码,则可选。请参见上面获取它的方法。 +- **CHAT_GPT_SESSION_TOKEN** :您的 OpenAI 帐户 session_token,如果您有电子邮件和密码,则可选。请参见 [这里](#b-使用-session-token) 获取 token。 - **CHAT_GPT_RETRY_TIMES** :当 OpenAI API 返回 429 或 503 时重试的次数。 @@ -169,6 +170,13 @@ npm run dev ![railway-success](docs/images/railway-succeed.png) +此外,在部署中,您可能会遇到以下问题: + +- **Error: ⚠️ No chatgpt item in pool**:此错误表示验证信息有问题。您可以从以下几个方面解决此问题:1.检查 token 或 openAI 账号和密码是否正确填写。2. token 可能已经过期(经验表明 token 的过期时间为**24**小时),您可以到 chatGPT 官网重新获取 token。3. 重新部署当前服务。请注意,应在铁路仪表板的 **Variables** 页面上修改上述内容。 +- **部署完成后,不会生成二维码**。尝试**刷新**页面,再次查看 Deploy Logs 面板是否生成了链接和二维码。 +- **生成的二维码无法扫描**。在生成的二维码上,有一个链接可以点击扫描二维码。 +- **消息反馈缓慢**。由于 Railway 的服务器部署在海外,消息反馈延迟会有所增加,但仍在可接受范围内。如果您对时间敏感,则可以使用自己的服务器部署。 + ## 作者 👤 **holegots** From afb92bb140bb637aac4d067bd0184c2a56a77d47 Mon Sep 17 00:00:00 2001 From: Orange Cheng <83146544+inannan423@users.noreply.github.com> Date: Sun, 11 Dec 2022 20:09:16 +0800 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 781bec5..46329ef 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ Besides, in deployment, you may encounter the following issues: - **Error: ⚠️ No chatgpt item in pool** : This error means that you have not configured the OpenAI account information correctly. You can solve this problem from the following aspects:1. Check whether the token or openAI account and password are filled in correctly. 2. The token may have expired (experience shows that the expiration time of the token is **24** hours), you can go to the chatGPT official website to re-obtain the token. 3. Redeploy Current Services.Note that the above should be modified on the Variables page in Railway Dashboard. - **After the deployment is complete, the QR code is not generated**.Try **refreshing** the page to see again if the Deploy Logs panel generated a link and QR code. - **The generated QR code cannot be scanned**.On the generated QR code, there is a link that can be clicked to scan the QR code. -- **Message feedback is very slow**.Because Rail's servers are deployed overseas, there is an increase in message feedback latency, but it is still within the acceptance range. If you are time sensitive, you can use your own server deployment. +- **Message feedback is very slow**.Because Railway's servers are deployed overseas, there is an increase in message feedback latency, but it is still within the acceptance range. If you are time sensitive, you can use your own server deployment. ## Author