diff --git a/main.go b/main.go
index 99cfe65..ce051d7 100644
--- a/main.go
+++ b/main.go
@@ -57,24 +57,40 @@ func webhook(update tg.APIUpdate) {
if err != nil {
fmt.Println(err)
// DO SOMETHING
+ return
}
photos := make([]tg.APIInlineQueryResultPhoto, len(results.Data))
for i, card := range results.Data {
- caption := fmt.Sprintf("Scryfall - EDHREC (#%d) - cardmarket (%s €)", card.ScryfallURI, card.RelatedUris.Edhrec, card.EdhrecRank, card.PurchaseUris.Magiccardmarket, 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.APIInlineKeyboardButton{
+ {
+ Text: "Scryfall",
+ URL: card.ScryfallURI,
+ }, {
+ Text: fmt.Sprintf("EDHREC (#%d)", card.EdhrecRank),
+ URL: card.RelatedUris.Edhrec,
+ }, {
+ Text: fmt.Sprintf("Cardmarket (%s €)", card.ScryfallURI),
+ URL: card.PurchaseUris.Magiccardmarket,
+ },
+ },
}
}
- api.AnswerInlineQuery(tg.InlineQueryResponse{
+ err = api.AnswerInlineQuery(tg.InlineQueryResponse{
QueryID: update.Inline.QueryID,
Results: photos,
})
+ if err != nil {
+ fmt.Println(err)
+ // DO SOMETHING
+ return
+ }
}()
}