From 7b674337c361af5b54f05a68be608c93c3d4128d Mon Sep 17 00:00:00 2001 From: shoopea Date: Thu, 9 Jan 2020 16:14:37 +0800 Subject: [PATCH] update --- cron.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cron.go b/cron.go index 8c4f5d8..794c190 100644 --- a/cron.go +++ b/cron.go @@ -14,7 +14,7 @@ func startCron() *cron.Cron { c.AddFunc("58 6,14,22 * * *", cronSetDef) c.AddFunc("02 1,3,5,9,11,13,17,19,21 * * *", cronGetHammerTime) c.AddFunc("10 7,15,23 * * *", cronGetHammerTime) - c.AddFunc("13 3, 7, 11, 15, 19, 23 * * *", cronTribute) + c.AddFunc("13 3,7,11,15,19,23 * * *", cronTribute) c.Start() return c } @@ -44,8 +44,12 @@ func cronSendWarReport() { func cronTribute() { muxClients.RLock() for _, c := range clients { - if c.Active && c.CWClass == `Knight` { - clientSendCWMsgDelay(c.TGUserID64, `/tributes`, 0) + if c.Active { + log.Printf("cronTribute : class %s (%s)\n", c.CWClass, c.Login) + if c.CWClass == `Knight` { + log.Printf("cronTribute : sending tribute\n", c.CWClass, c.Login) + clientSendCWMsgDelay(c.TGUserID64, `/tributes`, 0) + } } } muxClients.RUnlock()