Add caption editing
This commit is contained in:
parent
a99c4b181d
commit
7ea298ae9e
1 changed files with 5 additions and 1 deletions
6
main.go
6
main.go
|
@ -163,13 +163,17 @@ func webhook(update tg.APIUpdate) {
|
|||
card, err := scryfallGetCardByID(parts[1])
|
||||
facenum, _ := strconv.Atoi(parts[2])
|
||||
if err == nil {
|
||||
face, _, buttons := getCardEntry(card, facenum)
|
||||
face, caption, buttons := getCardEntry(card, facenum)
|
||||
api.EditMedia(tg.ClientEditMediaData{
|
||||
InlineID: *update.Callback.InlineID,
|
||||
Media: tg.APIInputMediaPhoto{
|
||||
Type: "photo",
|
||||
Media: face.Large,
|
||||
},
|
||||
})
|
||||
api.EditCaption(tg.ClientEditCaptionData{
|
||||
InlineID: *update.Callback.InlineID,
|
||||
Caption: caption,
|
||||
ReplyMarkup: &tg.APIInlineKeyboardMarkup{
|
||||
InlineKeyboard: [][]tg.APIInlineKeyboardButton{buttons},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue