在用户指定的时间段内随机发送信息#162
Open
zhangchi9 wants to merge 1 commit intosfyc23:masterfrom
Open
Conversation
Owner
|
这种方式,只是在一段时间内,随机选取一个时间进行定时发送吧。但之后的每天也是最开始这个时间开始的。并没有真正随机时间发送。 |
Author
|
是的, 之前的方式有问题, 做了更新, 现在是每天00:00:00生成随机时间, 然后设置运行时间为生成的时间 |
Owner
|
你这段代码也是一样,只生成一次随机时间,之后每次也是在这个生成的随机时间内生效。 |
Author
|
不是啊,每天00:00都会运行这个set_daily_alarm程序,每天都会生成新的随机时间 |
Owner
|
抱歉,应该是我看错了逻辑。我下午测试一下这段代码。上个周末更新的代码太多了,合并可能会麻烦一点。 |
|
所以,随机发送功能实现了吗。。。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根据issue #147 的建议, 在用户制定的时间段内, 随机挑选一个时间发送消息. 用户只需要在 _config.yaml 中添加时间段即可:
alarm_timed:
- "19:05 - 19:30"
- "7:30 -8:30"
- "6:30"