mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
取消提醒时避免重复取消
This commit is contained in:
parent
3e9605d484
commit
3058badffa
@ -250,9 +250,11 @@ func init() { // 插件主体
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
dateStrs := ctx.State["regex_matched"].([]string)
|
||||
ts := getFilledTimeStamp(dateStrs, true)
|
||||
t, ok := timers[getTimerInfo(&ts)]
|
||||
ti := getTimerInfo(&ts)
|
||||
t, ok := timers[ti]
|
||||
if ok {
|
||||
t.enable = false
|
||||
delete(timers, ti) //避免重复取消
|
||||
ctx.Send("取消成功~")
|
||||
} else {
|
||||
ctx.Send("没有这个定时器哦~")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user