kx-Huang / ChatGPT-on-WeChat

🤖️ Deploy GPT-4o ChatGPT on your WeChat within 2 steps! 两步在云端部署你的微信ChatGPT聊天机器人!🤖️
https://railway.app/template/zKIfYk
ISC License
781 stars 354 forks source link

重启应用后会收到历史消息,导致回复重复。 #67

Closed hdfk7 closed 3 months ago

hdfk7 commented 1 year ago

在chatgpt.ts定义一个启动时间 startTime: Date = new Date(); 然后在main.ts中的.on("message"方法中加入以下代码可以解决。 let msgDate = message.date(); if (msgDate.getTime() <= chatGPTBot.startTime.getTime()) { return; }

kx-Huang commented 1 year ago

好的,我去复现一下,谢谢

luglio13 commented 1 year ago

请问网站在线部署 需要怎么操作

kx-Huang commented 1 year ago

Please refer to this section in README, thanks.

kx-Huang commented 3 months ago

Fixed in latest commit. Thanks a lot for your help!