diff --git a/td.go b/td.go index b6d0f50..85e9bf3 100644 --- a/td.go +++ b/td.go @@ -156,9 +156,12 @@ func getHistory(c *tdlib.Client) { MsgID64: msg.ID, } - b, _ := json.Marshal(m) + b, err := json.Marshal(m) + if err != nil { + logOnError(err, "getHistory : Marshaling message.") + } - _ = ch.Publish( + err = ch.Publish( "", // exchange q.Name, // routing key false, // mandatory @@ -167,6 +170,9 @@ func getHistory(c *tdlib.Client) { ContentType: "application/json", Body: []byte(b), }) + if err != nil { + logOnError(err, "getHistory : Publishing message.") + } if msg.ID < lastMsgID64 { lastMsgID64 = msg.ID lastMsgTime = time.Unix(int64(msg.Date), 0)