From 194847c25bc1483083c5303659b6e86e3951b4a6 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Wed, 6 Jun 2018 12:48:00 +0300 Subject: [PATCH] update mg webhook response --- telegram.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/telegram.go b/telegram.go index 9589a70..47fe763 100644 --- a/telegram.go +++ b/telegram.go @@ -203,8 +203,19 @@ func mgWebhookHandler(w http.ResponseWriter, r *http.Request) { logger.Debugf("mgWebhookHandler sent %v", msg) } + rsp, err := json.Marshal(map[string]string{"external_message_id": strconv.Itoa(msg.MessageID)}) + if err != nil { + raven.CaptureErrorAndWait(err, nil) + logger.Error(err) + return + } + + if config.Debug { + logger.Debugf("mgWebhookHandler update %v", rsp) + } + w.WriteHeader(http.StatusOK) - w.Write([]byte("Message sent")) + w.Write(rsp) } if msg.Type == "message_updated" {