The telegram API documentation on inline bots notes the following:
You can display a special ‘Switch to PM’ button above the inline results (or instead of them)
This works fine for the mobile client, but when using the web-client, the 'Switch to PM' button is only displayed if the inline results list is not empty. The use case here is for bots that needs to sign in to some service before any results can be displayed for inline queries.
For example, the following (python-telegram-bot) does not work:
bot.answerInlineQuery(update.inline_query.id, results=[], switch_pm_text='Switch to private chat', switch_pm_parameter='do_something')
The telegram API documentation on inline bots notes the following:
This works fine for the mobile client, but when using the web-client, the 'Switch to PM' button is only displayed if the inline results list is not empty. The use case here is for bots that needs to sign in to some service before any results can be displayed for inline queries.
For example, the following (python-telegram-bot) does not work:
bot.answerInlineQuery(update.inline_query.id, results=[], switch_pm_text='Switch to private chat', switch_pm_parameter='do_something')
While this works as expected:
res_msg = InlineQueryResultArticle(uuid.uuid4(), 'some thing here', InputTextMessageContent('msg text')) bot.answerInlineQuery(update.inline_query.id, results=[res_msg], switch_pm_text='Switch to private chat', switch_pm_parameter='do_something')