Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

服务时间限制代码的逻辑问题 #1985

Closed
2 tasks done
infrost opened this issue May 15, 2024 · 1 comment
Closed
2 tasks done

服务时间限制代码的逻辑问题 #1985

infrost opened this issue May 15, 2024 · 1 comment

Comments

@infrost
Copy link

infrost commented May 15, 2024

前置确认

  • 我确认我运行的是最新版本的代码,并且安装了所需的依赖,在FAQS中也未找到类似问题。

⚠️ 搜索issues中是否已存在类似问题

  • 我已经搜索过issues和disscussions,没有跟我遇到的问题相关的issue

操作系统类型?

Windows

运行的python版本是?

python 3.7

使用的chatgpt-on-wechat版本是?

Latest Release

运行的channel类型是?

wx(个人微信, itchat)

复现步骤 🕹

在config.json中填入 "chat_start_time": "06:00","chat_stop_time": "01:00",会报错时间格式不正确。

问题描述 😯

我希望bot在次日凌晨1点关闭,早上六点打开(深夜停止服务),但是按照现在版本的代码逻辑在config.json中填入 "chat_start_time": "06:00","chat_stop_time": "01:00",会报错,原因出在time_check.py中的判断逻辑。

个人临时的解决办法是取消chat_time_check = chat_start_time < chat_stopt_time的检查,加入如下语句

if chat_stopt_time <= now_time <= chat_start_time:
期间停止服务
else
……

终端日志 📒

<此处粘贴终端日志>
@6vision
Copy link
Collaborator

6vision commented May 20, 2024

已提交修复,等合并后更新即可 #2002 ,也可以先测试一下是否有问题

@6vision 6vision closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants