I am reading the documentation, and while .sendMessage() method has reply_markup argument, where you can pass the inline keyboard, media group (album, few files together, etc) doesn't have such an argument.
# example with python-telegram-bot libriary
updater = Updater("token")
button = InlineKeyboardButton("this is a button.", callback_data="woo!")
# this works
updater.bot.sendPhoto("https://google.com/cat.png", reply_markup=InlineKeyboardMarkup([[button]]))
# but this doesn't
updater.bot.sendMediaGroup(InputMediaPhoto("https://google.com/cat.png"), reply_markup=InlineKeyboardMarkup([[button]]))
Just wanted to make sure that this is actually true, since every other type of message CAN have an inline keyboard.
Media groups can't have a reply markup. Neither the send_media_group method nor the InputMedia* classes (which is the correct input type for the media argument of send_media_group) have a corresponding argument.
Please see the docs of
send_media_group: PTB TelegramInputMediaPhoto: PTB Telegramand PTBs wiki entry on sending media groups.
Disclaimer: I'm currently the maintainer of python-telegram-bot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With