1
0
mirror of synced 2024-11-22 12:26:02 +03:00

fix for duplicated messages

This commit is contained in:
Pavel 2019-08-06 10:33:11 +03:00
parent aed2c049a0
commit 279a768ae9

View File

@ -599,6 +599,9 @@ func telegramWebhookHandler(c *gin.Context) {
if update.Message.ReplyToMessage != nil { if update.Message.ReplyToMessage != nil {
c.AbortWithStatus(http.StatusOK) 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 { } else {
c.Error(err) c.Error(err)
} }