您可以在媒体组中使用 Telegram 内联键盘吗?

Can you use Telegram Inline keyboards in media groups?

我正在阅读文档,而 .sendMessage() 方法有 reply_markup 参数,您可以在其中传递内联键盘,媒体组(相册、几个文件在一起等)没有这样的一个论点。

# 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]]))

只是想确保这是真的,因为所有其他类型的消息都可以有内联键盘。

媒体组不能有回复标记。 send_media_group 方法和 InputMedia* 类(这是 send_media_groupmedia 参数的正确输入类型)都没有相应的参数。

请参阅

的文档

PTBs wiki entry关于发送媒体组。


免责声明:我目前是 python-telegram-bot.

的维护者