How to show telegram bot inline keyboard button with safe url

不打扰是莪最后的温柔 提交于 2019-12-12 09:21:58

问题


I have the following code:

  inline_keyboard: [
    [{ text: 'Authorize', callback_data: '1', url: 'https://google.com' }],
  ],

When I press the button that comes out this code, the resulting url is modified to:

tg://unsafe_url?url=https%3A%2F%2Fgoogle.com%2F

Then, when the user presses the button, a confirmation modal appears.

I've seen other bots with url buttons that don't have that confirmation button. For example https://ifttt.com connects with telegram and has buttons that I guess are safe.

The telegram documentation doesn't mention unsafe urls: https://core.telegram.org/bots/api#inlinekeyboardbutton

I'd like to avoid that modal and go straight to the link. Is there some approval process that needs to happen?

Thanks.


回答1:


IFTTT is "verified" bot so it doesn't show any confirmation windows. For any other bot, if you "hide" URL in text, such window will be shown (so that user knows what website he opens).
Some clients (for example, Telegram Desktop doesn't show confirmation windows for telegram.org domain.



来源:https://stackoverflow.com/questions/47312585/how-to-show-telegram-bot-inline-keyboard-button-with-safe-url

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