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 (
|
||||
config *TransportConfig
|
||||
orm *Orm
|
||||
logger *logging.Logger
|
||||
options Options
|
||||
parser = flags.NewParser(&options, flags.Default)
|
||||
rx = regexp.MustCompile(`/+$`)
|
||||
config *TransportConfig
|
||||
orm *Orm
|
||||
logger *logging.Logger
|
||||
options Options
|
||||
parser = flags.NewParser(&options, flags.Default)
|
||||
rx = regexp.MustCompile(`/+$`)
|
||||
currency = map[string]string{
|
||||
"rub": "₽",
|
||||
"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)
|
||||
}
|
||||
|
||||
} else if msg.Data.Type == v1.MsgTypeOrder {
|
||||
mb = "**Заказ"
|
||||
|
||||
if msg.Data.Order.Number != ""{
|
||||
if msg.Data.Order.Number != "" {
|
||||
mb += " " + msg.Data.Order.Number
|
||||
}
|
||||
|
||||
@ -527,8 +527,8 @@ func mgWebhookHandler(c *gin.Context) {
|
||||
|
||||
mb += "**\n"
|
||||
if len(msg.Data.Order.Items) > 0 {
|
||||
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)])
|
||||
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)])
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user