From a87dc5e7f3864db4257c32aba3fe738c74e13fdd Mon Sep 17 00:00:00 2001 From: shoopea Date: Tue, 14 Jan 2020 14:23:27 +0800 Subject: [PATCH] test --- bot.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bot.go b/bot.go index 8b70279..81dcd44 100644 --- a/bot.go +++ b/bot.go @@ -106,7 +106,7 @@ func botQuery(q *tb.Query) { func botText(m *tb.Message) { PrintText(m) - if (m.Chat.ID == cfg.Bot.Depositchat || m.Chat.ID == cfg.Bot.Mainchat) && m.IsForwarded() && int64(m.OriginalSender.ID) == chtwrsbotID64 { + if m.IsForwarded() && int64(m.OriginalSender.ID) == chtwrsbotID64 { cwm := ChatWarsMessage{ TGUserID64: int64(m.Sender.ID), TGSenderUserID64: chtwrsbotID64, @@ -117,6 +117,17 @@ func botText(m *tb.Message) { IsForwarded: true, } MQCWMsgQueue <- cwm + } else if (m.Chat.ID == cfg.Bot.Depositchat || m.Chat.ID == cfg.Bot.Mainchat) && !m.IsForwarded() { + cwm := ChatWarsMessage{ + TGUserID64: int64(m.Sender.ID), + TGSenderUserID64: int64(m.Sender.ID), + ID64: int64(m.ID), + ChatID64: int64(m.Chat.ID), + Text: m.Text, + Date: m.Time().UTC(), + IsForwarded: false, + } + MQCWMsgQueue <- cwm } // all the text messages that weren't // captured by existing handlers