test forward from bottext

This commit is contained in:
shoopea 2019-10-21 10:25:41 +08:00
parent 0338338c14
commit 8032944160
2 changed files with 13 additions and 11 deletions

22
bot.go
View File

@ -103,17 +103,19 @@ func botText(m *tb.Message) {
b, _ := json.Marshal(m) b, _ := json.Marshal(m)
log.Printf("botText : %s\n", string(b)) log.Printf("botText : %s\n", string(b))
/* if (m.Chat.ID == cfg.Bot.Depositchat || m.Chat.ID == cfg.Bot.Mainchat) && int64(m.OriginalSender) == chtwrsbotID64 {
if (m.Chat.ID == cfg.Bot.Depositchat && int64(m.OriginalSender) == 408101137) { cwm := ChatWarsMessage{
cwm := ChatWarsMessage{ TGUserID64: int64(m.Sender.ID),
TGUserID64: int64(m.Sender.ID), TGSenderUserID64: chtwrsbotID64,
TGSenderUserID64: int64(m.OriginalSender), ID64: int64(m.ID),
ID64: int64(m.ID), ChatID64: int64(m.Chat.ID),
ChatID64: updateMsg.Message.ChatID, Text: m.Text,
Text: txt, Date: m.Time().UTC(),
} IsForwarded: true,
} }
*/ MQCWMsgQueue <- cwm
}
// all the text messages that weren't // all the text messages that weren't
// captured by existing handlers // captured by existing handlers
} }

View File

@ -387,7 +387,7 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
_, err := parseSubTypeMessageQuestResultAmbush(m, rule.re) _, err := parseSubTypeMessageQuestResultAmbush(m, rule.re)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageQuestResultAmbush.") logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageQuestResultAmbush.")
if m.Date.Add(3 * time.Minute).After(time.Now().UTC()) { if m.Date.Add(3 * time.Minute).After(time.Now().UTC()) {
if m.ChatID64 == chtwrsbotID64 { if m.ChatID64 == chtwrsbotID64 && m.TGSenderUserID64 == chtwrsbotID64 {
s := TGCommand{ s := TGCommand{
Type: commandForwardMsg, Type: commandForwardMsg,
FromUserID64: m.TGUserID64, FromUserID64: m.TGUserID64,