mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
✨ 修复 timer 计时错误
This commit is contained in:
parent
4dc8e5619c
commit
7b52599da7
@ -92,7 +92,7 @@ func (c *Clock) RegisterTimer(ts *Timer, save bool) {
|
|||||||
}
|
}
|
||||||
log.Printf("[群管]注册计时器[%t]%s", ts.Enable, key)
|
log.Printf("[群管]注册计时器[%t]%s", ts.Enable, key)
|
||||||
for ts.Enable {
|
for ts.Enable {
|
||||||
var dur time.Duration
|
dur := time.Minute
|
||||||
isThisMonth := ts.Month < 0 || ts.Month == int32(time.Now().Month())
|
isThisMonth := ts.Month < 0 || ts.Month == int32(time.Now().Month())
|
||||||
if isThisMonth {
|
if isThisMonth {
|
||||||
isThisDay := ts.Day < 0 || ts.Day == int32(time.Now().Day())
|
isThisDay := ts.Day < 0 || ts.Day == int32(time.Now().Day())
|
||||||
@ -161,9 +161,7 @@ func (c *Clock) ListTimers(grpID uint64) []string {
|
|||||||
if strings.Contains(k, g) {
|
if strings.Contains(k, g) {
|
||||||
start := strings.Index(k, "]")
|
start := strings.Index(k, "]")
|
||||||
msg := strings.ReplaceAll(k[start+1:]+"\n", "-1", "每")
|
msg := strings.ReplaceAll(k[start+1:]+"\n", "-1", "每")
|
||||||
msg = strings.ReplaceAll(msg, "日0周", "日的")
|
msg = strings.ReplaceAll(msg, "日0周", "日周天")
|
||||||
msg = strings.ReplaceAll(msg, "周", "的")
|
|
||||||
msg = strings.ReplaceAll(msg, "月0日", "月周")
|
|
||||||
keys = append(keys, msg)
|
keys = append(keys, msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user