From 194847c25bc1483083c5303659b6e86e3951b4a6 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Wed, 6 Jun 2018 12:48:00 +0300 Subject: [PATCH 1/2] 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" { From 23f6a0500cb724ee3669232fcf3644cb12c8914b Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Wed, 6 Jun 2018 12:54:40 +0300 Subject: [PATCH 2/2] update mg webhook response --- telegram.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram.go b/telegram.go index 47fe763..e7d433b 100644 --- a/telegram.go +++ b/telegram.go @@ -211,7 +211,7 @@ func mgWebhookHandler(w http.ResponseWriter, r *http.Request) { } if config.Debug { - logger.Debugf("mgWebhookHandler update %v", rsp) + logger.Debugf("mgWebhookHandler sent response %v", rsp) } w.WriteHeader(http.StatusOK)