diff --git a/src/routing.go b/src/routing.go index d2f5621..d48e4bb 100644 --- a/src/routing.go +++ b/src/routing.go @@ -587,7 +587,7 @@ func mgWebhookHandler(c *gin.Context) { var mb string switch msg.Data.Type { case v1.MsgTypeProduct: - mb = fmt.Sprintf("%s\n", msg.Data.Product.Name) + mb = fmt.Sprintf("*%s*\n", msg.Data.Product.Name) if msg.Data.Product.Cost != nil && msg.Data.Product.Cost.Value != 0 { mb += fmt.Sprintf( @@ -624,6 +624,8 @@ func mgWebhookHandler(c *gin.Context) { m.ReplyToMessageID = qid } + m.ParseMode = "Markdown" + msgSend, err := bot.Send(m) if err != nil { logger.Error(err) @@ -669,7 +671,7 @@ func mgWebhookHandler(c *gin.Context) { } func getOrderMessage(dataOrder *v1.MessageDataOrder) string { - mb := getLocalizedMessage("order") + mb := "*" + getLocalizedMessage("order") if dataOrder.Number != "" { mb += " " + dataOrder.Number @@ -678,7 +680,7 @@ func getOrderMessage(dataOrder *v1.MessageDataOrder) string { if dataOrder.Date != "" { mb += fmt.Sprintf(" (%s)", dataOrder.Date) } - mb += "\n" + mb += "*\n" if len(dataOrder.Items) > 0 { mb += "\n" for k, v := range dataOrder.Items { @@ -691,7 +693,7 @@ func getOrderMessage(dataOrder *v1.MessageDataOrder) string { if v.Quantity != nil { if v.Quantity.Value != 0 { mb += fmt.Sprintf( - " %v", + " _%v_", v.Quantity.Value, ) } @@ -700,7 +702,7 @@ func getOrderMessage(dataOrder *v1.MessageDataOrder) string { if v.Price != nil { if val, ok := currency[strings.ToLower(v.Price.Currency)]; ok { mb += fmt.Sprintf( - " x %s\n", + " _x %s_\n", getLocalizedTemplateMessage( "cost_currency", map[string]interface{}{ @@ -719,7 +721,7 @@ func getOrderMessage(dataOrder *v1.MessageDataOrder) string { if dataOrder.Delivery != nil { if dataOrder.Delivery.Name != "" { mb += fmt.Sprintf( - "\n%s:\n%s", + "\n*%s:*\n%s", getLocalizedMessage("delivery"), dataOrder.Delivery.Name, ) @@ -749,7 +751,7 @@ func getOrderMessage(dataOrder *v1.MessageDataOrder) string { if len(dataOrder.Payments) > 0 { mb += fmt.Sprintf( - "\n%s:\n", + "\n*%s:*\n", getLocalizedMessage("payment"), ) for _, v := range dataOrder.Payments { diff --git a/translate/translate.en.yml b/translate/translate.en.yml index b160a5c..e40bdb4 100644 --- a/translate/translate.en.yml +++ b/translate/translate.en.yml @@ -48,4 +48,4 @@ order: "Order" delivery: "Delivery" payment: "Payment" order_total: "Order total" -cost_currency: "{{.Amount}} {{.Currency}}" +cost_currency: "{{.Currency}}{{.Amount}}"