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