1
0
mirror of synced 2024-11-22 04:26:01 +03:00

Merge pull request #54 from DmitryZagorulko/master

replace markdown symbols in messages
This commit is contained in:
Alex Lushpai 2018-11-20 12:26:16 +03:00 committed by GitHub
commit 05530ffda1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -615,7 +615,7 @@ func mgWebhookHandler(c *gin.Context) {
case v1.MsgTypeOrder: case v1.MsgTypeOrder:
mb = getOrderMessage(msg.Data.Order) mb = getOrderMessage(msg.Data.Order)
case v1.MsgTypeText: case v1.MsgTypeText:
mb = msg.Data.Content mb = replaceMarkdownSymbols(msg.Data.Content)
} }
m := tgbotapi.NewMessage(cid, mb) m := tgbotapi.NewMessage(cid, mb)
@ -644,7 +644,7 @@ func mgWebhookHandler(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"external_message_id": strconv.Itoa(msgSend.MessageID)}) c.JSON(http.StatusOK, gin.H{"external_message_id": strconv.Itoa(msgSend.MessageID)})
case "message_updated": case "message_updated":
msgSend, err := bot.Send(tgbotapi.NewEditMessageText(cid, uid, msg.Data.Content)) msgSend, err := bot.Send(tgbotapi.NewEditMessageText(cid, uid, replaceMarkdownSymbols(msg.Data.Content)))
if err != nil { if err != nil {
logger.Error(err) logger.Error(err)
c.AbortWithStatus(http.StatusBadRequest) c.AbortWithStatus(http.StatusBadRequest)