This commit is contained in:
shoopea 2019-06-11 10:57:02 +08:00
parent b69c2877a9
commit 73c8b79fd5
2 changed files with 2 additions and 1 deletions

1
mq.go
View File

@ -86,6 +86,7 @@ func MQReceiveMsgWorker(id int, cmd chan<- TGCommand) {
err = json.Unmarshal(d.Body, &c) err = json.Unmarshal(d.Body, &c)
logOnError(err, "MQReceiveMsgWorker["+strconv.Itoa(id)+"] : Can't unmarshal.\n"+string(d.Body)) logOnError(err, "MQReceiveMsgWorker["+strconv.Itoa(id)+"] : Can't unmarshal.\n"+string(d.Body))
if err == nil { if err == nil {
log.Printf("****************************** New MQ message ******************************\n%s\n****************************************************************************\n", string(d.Body))
cmd <- c cmd <- c
} }
} }

2
td.go
View File

@ -36,7 +36,7 @@ func ListenMQ(c *tdlib.Client, msgs <-chan TGCommand) {
now = time.Now() now = time.Now()
} }
b, _ := json.Marshal(m) b, _ := json.Marshal(m)
log.Printf("****************************** New MQ message ******************************\n%s\n****************************************************************************\n", string(b)) log.Printf("****************************** New MQ command ******************************\n%s\n****************************************************************************\n", string(b))
switch m.Type { switch m.Type {
case commandSendMsg: case commandSendMsg:
msgTxt := tdlib.NewInputMessageText(tdlib.NewFormattedText(m.Text, nil), true, true) msgTxt := tdlib.NewInputMessageText(tdlib.NewFormattedText(m.Text, nil), true, true)