Added different formatting for telegram bot

This commit is contained in:
Artyom Belousov 2021-06-06 17:21:29 +03:00
parent 35f8fa5a57
commit 89623f5f6a
18 changed files with 233 additions and 173 deletions

View file

@ -9,6 +9,8 @@ import (
"net/url"
"strconv"
"strings"
"gitlab.com/flygrounder/go-mtg-vk/internal/cardsinfo"
)
const sendMessageUrl = "https://api.vk.com/method/messages.send"
@ -22,6 +24,11 @@ type ApiSender struct {
Logger *log.Logger
}
func (s *ApiSender) SendPrices(userId int64, cardName string, prices []cardsinfo.ScgCardPrice) {
msg := formatCardPrices(cardName, prices)
s.Send(userId, msg)
}
type sendMessageResponse struct {
Error errorResponse `json:"error"`
}