Telegram callback_data for link buttons

那年仲夏 提交于 2020-05-02 05:29:50

问题


I'm sending a link button throught a Telegram bot and I would like to get the callback_data after the user opens the url.

My options are:

var options = {
          parse_mode: "Markdown",
          reply_markup: {
            inline_keyboard: btns
          }
        };

where btns is

[
    [{ text: "Read first", url: "http://any", callback_data: "any_relevant_data }]
]

The button shows perfectly, the link works, but no callback is triggered and I never hit

bot.on('callback_query', (callback_message) => { //any action });

Is this a missing feature or it's me, doing something wrong?


回答1:


According to API Document, you can't use url and text in the same time.

This object represents one button of an inline keyboard.

You must use exactly one of the optional fields.



来源:https://stackoverflow.com/questions/47545531/telegram-callback-data-for-link-buttons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!