test
This commit is contained in:
parent
b69c2877a9
commit
73c8b79fd5
1
mq.go
1
mq.go
@ -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
2
td.go
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user