This commit is contained in:
shoopea 2019-12-29 19:02:14 +08:00
parent fb32e622cb
commit fdc13e4ac3

9
bot.go
View File

@ -101,10 +101,10 @@ func botQuery(q *tb.Query) {
func botText(m *tb.Message) { func botText(m *tb.Message) {
PrintText(m) PrintText(m)
log.Printf("botText : m.Chat.ID : %d\n", m.Chat.ID) b, _ := json.Marshal(m)
log.Printf("botText : m.OriginalSender.ID : %d\n", m.OriginalSender.ID) log.Printf("botText : %s\n", string(b))
if (m.Chat.ID == cfg.Bot.Depositchat || m.Chat.ID == cfg.Bot.Mainchat) && m.OriginalSender != nil && int64(m.OriginalSender.ID) == chtwrsbotID64 { if (m.Chat.ID == cfg.Bot.Depositchat || m.Chat.ID == cfg.Bot.Mainchat) && int64(m.OriginalSender.ID) == chtwrsbotID64 {
log.Printf("botText : forwarding message.\n") log.Printf("botText : forwarding message.\n")
cwm := ChatWarsMessage{ cwm := ChatWarsMessage{
TGUserID64: int64(m.Sender.ID), TGUserID64: int64(m.Sender.ID),
@ -119,8 +119,7 @@ func botText(m *tb.Message) {
} else { } else {
log.Printf("botText : printing message.\n") log.Printf("botText : printing message.\n")
b, _ := json.Marshal(m)
log.Printf("botText : %s\n", string(b))
} }
// all the text messages that weren't // all the text messages that weren't
// captured by existing handlers // captured by existing handlers