This commit is contained in:
shoopea 2020-01-16 23:50:57 +08:00
parent 109f38e470
commit a2b294b708
3 changed files with 8 additions and 3 deletions

2
job.go
View File

@ -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)

View File

@ -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")

View File

@ -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)