From 279a768ae9e98a5a4f1cfeeb7f9ee52d53e1b368 Mon Sep 17 00:00:00 2001 From: Pavel Date: Tue, 6 Aug 2019 10:33:11 +0300 Subject: [PATCH] fix for duplicated messages --- src/routing.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/routing.go b/src/routing.go index cab1fb1..2bca50a 100644 --- a/src/routing.go +++ b/src/routing.go @@ -599,6 +599,9 @@ func telegramWebhookHandler(c *gin.Context) { if update.Message.ReplyToMessage != nil { c.AbortWithStatus(http.StatusOK) + } else if st == http.StatusBadRequest && err.Error() == "Message with passed external_id already exists" { + logger.Errorf("Message with externalId '%s' is already exists - ignoring it", snd.Message.ExternalID) + c.JSON(http.StatusOK, gin.H{}) } else { c.Error(err) }