Tweak caption

This commit is contained in:
Hamcha 2018-09-17 14:49:43 +02:00
parent 86dabaacf4
commit 6e7e0fbc31
Signed by: hamcha
GPG key ID: A40413D21021EAEE

View file

@ -62,22 +62,24 @@ func webhook(update tg.APIUpdate) {
photos := make([]tg.APIInlineQueryResultPhoto, len(results.Data))
for i, card := range results.Data {
caption := fmt.Sprintf("EDHREC rank: #%d - cardmarket: € %s", card.EdhrecRank, card.Eur)
photos[i] = tg.APIInlineQueryResultPhoto{
Type: "photo",
ResultID: card.ID,
PhotoURL: card.ImageUris.Large,
ThumbURL: card.ImageUris.Normal,
Title: card.Name,
Caption: caption,
ReplyMarkup: &tg.APIInlineKeyboardMarkup{
InlineKeyboard: [][]tg.APIInlineKeyboardButton{{
{
Text: "Scryfall",
URL: card.ScryfallURI,
}, {
Text: fmt.Sprintf("EDHREC (#%d)", card.EdhrecRank),
Text: "EDHREC",
URL: card.RelatedUris.Edhrec,
}, {
Text: fmt.Sprintf("Cardmarket (%s €)", card.ScryfallURI),
Text: "MKM",
URL: card.PurchaseUris.Magiccardmarket,
},
}},