diff --git a/bot.go b/bot.go index 5527bf7..31d9697 100644 --- a/bot.go +++ b/bot.go @@ -103,17 +103,19 @@ func botText(m *tb.Message) { b, _ := json.Marshal(m) log.Printf("botText : %s\n", string(b)) - /* - if (m.Chat.ID == cfg.Bot.Depositchat && int64(m.OriginalSender) == 408101137) { - cwm := ChatWarsMessage{ - TGUserID64: int64(m.Sender.ID), - TGSenderUserID64: int64(m.OriginalSender), - ID64: int64(m.ID), - ChatID64: updateMsg.Message.ChatID, - Text: txt, - } + if (m.Chat.ID == cfg.Bot.Depositchat || m.Chat.ID == cfg.Bot.Mainchat) && int64(m.OriginalSender) == chtwrsbotID64 { + cwm := ChatWarsMessage{ + TGUserID64: int64(m.Sender.ID), + TGSenderUserID64: chtwrsbotID64, + ID64: int64(m.ID), + ChatID64: int64(m.Chat.ID), + Text: m.Text, + Date: m.Time().UTC(), + IsForwarded: true, } - */ + MQCWMsgQueue <- cwm + + } // all the text messages that weren't // captured by existing handlers } diff --git a/workers.go b/workers.go index 0da6757..5594e95 100644 --- a/workers.go +++ b/workers.go @@ -387,7 +387,7 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) { _, err := parseSubTypeMessageQuestResultAmbush(m, rule.re) logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageQuestResultAmbush.") if m.Date.Add(3 * time.Minute).After(time.Now().UTC()) { - if m.ChatID64 == chtwrsbotID64 { + if m.ChatID64 == chtwrsbotID64 && m.TGSenderUserID64 == chtwrsbotID64 { s := TGCommand{ Type: commandForwardMsg, FromUserID64: m.TGUserID64,