fmt
This commit is contained in:
parent
8a2e01b4bb
commit
b4c72d760e
12
src/main.go
12
src/main.go
@ -15,12 +15,12 @@ type Options struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
config *TransportConfig
|
config *TransportConfig
|
||||||
orm *Orm
|
orm *Orm
|
||||||
logger *logging.Logger
|
logger *logging.Logger
|
||||||
options Options
|
options Options
|
||||||
parser = flags.NewParser(&options, flags.Default)
|
parser = flags.NewParser(&options, flags.Default)
|
||||||
rx = regexp.MustCompile(`/+$`)
|
rx = regexp.MustCompile(`/+$`)
|
||||||
currency = map[string]string{
|
currency = map[string]string{
|
||||||
"rub": "₽",
|
"rub": "₽",
|
||||||
"uah": "₴",
|
"uah": "₴",
|
||||||
|
@ -510,14 +510,14 @@ func mgWebhookHandler(c *gin.Context) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if msg.Data.Product.Img != "" {
|
if msg.Data.Product.Img != "" {
|
||||||
mb = fmt.Sprintf("\n%s", msg.Data.Product.Img)
|
mb = fmt.Sprintf("\n%s", msg.Data.Product.Img)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if msg.Data.Type == v1.MsgTypeOrder {
|
} else if msg.Data.Type == v1.MsgTypeOrder {
|
||||||
mb = "**Заказ"
|
mb = "**Заказ"
|
||||||
|
|
||||||
if msg.Data.Order.Number != ""{
|
if msg.Data.Order.Number != "" {
|
||||||
mb += " " + msg.Data.Order.Number
|
mb += " " + msg.Data.Order.Number
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,8 +527,8 @@ func mgWebhookHandler(c *gin.Context) {
|
|||||||
|
|
||||||
mb += "**\n"
|
mb += "**\n"
|
||||||
if len(msg.Data.Order.Items) > 0 {
|
if len(msg.Data.Order.Items) > 0 {
|
||||||
for _, v := range msg.Data.Order.Items {
|
for _, v := range msg.Data.Order.Items {
|
||||||
mb += fmt.Sprintf("%s %v x %v %s\n", v.Name, v.Quantity.Value, v.Price.Value, currency[strings.ToLower(v.Price.Currency)])
|
mb += fmt.Sprintf("%s %v x %v %s\n", v.Name, v.Quantity.Value, v.Price.Value, currency[strings.ToLower(v.Price.Currency)])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user