zhukov / webogram

Telegram web application, GPL v3
https://web.telegram.org
GNU General Public License v3.0
7.95k stars 2.35k forks source link

"Switch to PM" inline message not displayed with empty inline results list #1484

Open s3c opened 7 years ago

s3c commented 7 years ago

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')

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')

Dotrox commented 5 years ago

I have exactly the same issue! Will it be fixed?