1
0
mirror of synced 2024-11-25 05:06:03 +03:00

Merge pull request #78 from Neur0toxine/master

fix for duplicated messages
This commit is contained in:
Alex Lushpai 2019-08-06 10:41:07 +03:00 committed by GitHub
commit e3f64636a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}