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)) photos := make([]tg.APIInlineQueryResultPhoto, len(results.Data))
for i, card := range results.Data { for i, card := range results.Data {
caption := fmt.Sprintf("EDHREC rank: #%d - cardmarket: € %s", card.EdhrecRank, card.Eur)
photos[i] = tg.APIInlineQueryResultPhoto{ photos[i] = tg.APIInlineQueryResultPhoto{
Type: "photo", Type: "photo",
ResultID: card.ID, ResultID: card.ID,
PhotoURL: card.ImageUris.Large, PhotoURL: card.ImageUris.Large,
ThumbURL: card.ImageUris.Normal, ThumbURL: card.ImageUris.Normal,
Title: card.Name, Title: card.Name,
Caption: caption,
ReplyMarkup: &tg.APIInlineKeyboardMarkup{ ReplyMarkup: &tg.APIInlineKeyboardMarkup{
InlineKeyboard: [][]tg.APIInlineKeyboardButton{{ InlineKeyboard: [][]tg.APIInlineKeyboardButton{{
{ {
Text: "Scryfall", Text: "Scryfall",
URL: card.ScryfallURI, URL: card.ScryfallURI,
}, { }, {
Text: fmt.Sprintf("EDHREC (#%d)", card.EdhrecRank), Text: "EDHREC",
URL: card.RelatedUris.Edhrec, URL: card.RelatedUris.Edhrec,
}, { }, {
Text: fmt.Sprintf("Cardmarket (%s €)", card.ScryfallURI), Text: "MKM",
URL: card.PurchaseUris.Magiccardmarket, URL: card.PurchaseUris.Magiccardmarket,
}, },
}}, }},