From a2b294b7082147a0b6aee7147c0c0b8ac9f5769b Mon Sep 17 00:00:00 2001 From: shoopea Date: Thu, 16 Jan 2020 23:50:57 +0800 Subject: [PATCH] test --- job.go | 2 ++ main.go | 7 +++++-- rules.go | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/job.go b/job.go index 9c5f14b..7383f1b 100644 --- a/job.go +++ b/job.go @@ -1384,6 +1384,8 @@ func jobGWithdraw(j Job) { doneTab map[int64]int64 ) + log.Printf("jobGWithdraw[%d] : test %d / %d.\n", j.ID64, botUserID64, bot.Me.ID) + log.Printf("jobGWithdraw[%d] : Starting.\n", j.ID64) reqTab = make(map[int64]int64) diff --git a/main.go b/main.go index 75090fc..873339d 100644 --- a/main.go +++ b/main.go @@ -21,8 +21,9 @@ var ( config = flag.String("config", "config.json", "config file path") initdb = flag.Bool("initdb", false, "initialize bot database") - db *sql.DB - bot *tb.Bot + db *sql.DB + bot *tb.Bot + botUserID64 int64 cr *cron.Cron @@ -102,6 +103,8 @@ func main() { URL: cfg.Telegram.URL, Poller: &tb.LongPoller{Timeout: 10 * time.Second}, }) + botUserID64 = int64(bot.Me.ID) + failOnError(err, "Registering bot") log.Println("Bot registered") diff --git a/rules.go b/rules.go index 3ba639a..133f0aa 100644 --- a/rules.go +++ b/rules.go @@ -25,7 +25,7 @@ func resetMsgParsingRules() error { Rule: "^To validate (@[A-Za-z0-9]*) withdrawal of\n([0-9]+ x .*\n)+(Click /withdraw_[a-f0-9]{32})$", MsgTypeID64: cacheObjSubType[`msg_guild_gwithdraw_req`], ChatID64: cfg.Bot.Mainchat, - SenderUserID64: 0, + SenderUserID64: botUserID64, } rules2 = append(rules2, r)