Skip to content

Commit

Permalink
定时任务 报时任务补充分钟的播报
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Aug 3, 2023
1 parent 85369c4 commit c747e53
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,9 @@ cmd输入命令即可:`doctoc /path/to/file`
- 定时任务GUI支持动态加载
- b站接入定时任务

### 2023-08-03
- 定时任务 报时任务补充分钟的播报

</details>


Expand Down
14 changes: 7 additions & 7 deletions bilibili.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ def schedule_task(index):
hour, min = common.get_bj_time(6)

if 0 <= hour and hour < 6:
time = f"凌晨{hour}点"
time = f"凌晨{hour}{min}"
elif 6 <= hour and hour < 9:
time = f"早晨{hour}点"
time = f"早晨{hour}{min}"
elif 9 <= hour and hour < 12:
time = f"上午{hour}点"
time = f"上午{hour}{min}"
elif hour == 12:
time = f"中午{hour}点"
time = f"中午{hour}{min}"
elif 13 <= hour and hour < 18:
time = f"下午{hour - 12}点"
time = f"下午{hour - 12}{min}"
elif 18 <= hour and hour < 20:
time = f"傍晚{hour - 12}点"
time = f"傍晚{hour - 12}{min}"
elif 20 <= hour and hour < 24:
time = f"晚上{hour - 12}点"
time = f"晚上{hour - 12}{min}"


# 根据对应索引从列表中随机获取一个值
Expand Down
14 changes: 7 additions & 7 deletions dy.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ def schedule_task(index):
hour, min = common.get_bj_time(6)

if 0 <= hour and hour < 6:
time = f"凌晨{hour}点"
time = f"凌晨{hour}{min}"
elif 6 <= hour and hour < 9:
time = f"早晨{hour}点"
time = f"早晨{hour}{min}"
elif 9 <= hour and hour < 12:
time = f"上午{hour}点"
time = f"上午{hour}{min}"
elif hour == 12:
time = f"中午{hour}点"
time = f"中午{hour}{min}"
elif 13 <= hour and hour < 18:
time = f"下午{hour - 12}点"
time = f"下午{hour - 12}{min}"
elif 18 <= hour and hour < 20:
time = f"傍晚{hour - 12}点"
time = f"傍晚{hour - 12}{min}"
elif 20 <= hour and hour < 24:
time = f"晚上{hour - 12}点"
time = f"晚上{hour - 12}{min}"


# 根据对应索引从列表中随机获取一个值
Expand Down

0 comments on commit c747e53

Please sign in to comment.