Add EDHREC Rank

This commit is contained in:
Hamcha 2018-09-17 14:19:11 +02:00
parent 3b5f8a0934
commit a4471f449c
Signed by: hamcha
GPG key ID: A40413D21021EAEE
2 changed files with 2 additions and 1 deletions

View file

@ -61,7 +61,7 @@ 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("<a href=\"%s\">Scryfall</a> - <a href=\"%s\">EDHREC</a> - <a href=\"%s\">cardmarket</a> (%s €)", card.ScryfallURI, card.RelatedUris.Edhrec, card.PurchaseUris.Magiccardmarket) caption := fmt.Sprintf("<a href=\"%s\">Scryfall</a> - <a href=\"%s\">EDHREC</a> (#%d) - <a href=\"%s\">cardmarket</a> (%s €)", card.ScryfallURI, card.RelatedUris.Edhrec, card.EdhrecRank, card.PurchaseUris.Magiccardmarket, card.Eur)
photos[i] = tg.APIInlineQueryResultPhoto{ photos[i] = tg.APIInlineQueryResultPhoto{
Type: "photo", Type: "photo",
ResultID: card.ID, ResultID: card.ID,

View file

@ -30,6 +30,7 @@ type CardData struct {
BorderCrop string `json:"border_crop"` BorderCrop string `json:"border_crop"`
} `json:"image_uris"` } `json:"image_uris"`
Eur string `json:"eur"` Eur string `json:"eur"`
EdhrecRank int `json:"edhrec_rank"`
RelatedUris struct { RelatedUris struct {
Gatherer string `json:"gatherer"` Gatherer string `json:"gatherer"`
TcgplayerDecks string `json:"tcgplayer_decks"` TcgplayerDecks string `json:"tcgplayer_decks"`