Skip to content

Commit

Permalink
✨ 修复 timer 计时错误
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Oct 26, 2021
1 parent 4dc8e56 commit 7b52599
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugin_manager/timer/timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (c *Clock) RegisterTimer(ts *Timer, save bool) {
}
log.Printf("[群管]注册计时器[%t]%s", ts.Enable, key)
for ts.Enable {
var dur time.Duration
dur := time.Minute
isThisMonth := ts.Month < 0 || ts.Month == int32(time.Now().Month())
if isThisMonth {
isThisDay := ts.Day < 0 || ts.Day == int32(time.Now().Day())
Expand Down Expand Up @@ -161,9 +161,7 @@ func (c *Clock) ListTimers(grpID uint64) []string {
if strings.Contains(k, g) {
start := strings.Index(k, "]")
msg := strings.ReplaceAll(k[start+1:]+"\n", "-1", "每")
msg = strings.ReplaceAll(msg, "日0周", "日的")
msg = strings.ReplaceAll(msg, "周", "的")
msg = strings.ReplaceAll(msg, "月0日", "月周")
msg = strings.ReplaceAll(msg, "日0周", "日周天")
keys = append(keys, msg)
}
}
Expand Down

0 comments on commit 7b52599

Please sign in to comment.