Skip to content

Commit

Permalink
fix: 早上5点前早报提示
Browse files Browse the repository at this point in the history
  • Loading branch information
yqchilde committed Mar 3, 2023
1 parent eb6ca89 commit f1d51c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/zaobao/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func init() {
ctx.ReplyTextAndAt("请先私聊机器人配置token\n指令:set zaobao token __\n相关秘钥申请地址:https://admin.alapi.cn")
return
}
if time.Now().Hour() < 5 {
ctx.ReplyTextAndAt("早报数据每天5点后更新,当前时间不可用")
return
}
imgCache := filepath.Join(engine.GetCacheFolder(), time.Now().Local().Format("20060102")+".jpg")
if !utils.IsImageFile(imgCache) {
if err := flushZaoBao(zaoBao.Token, imgCache); err != nil {
Expand Down

0 comments on commit f1d51c3

Please sign in to comment.