[BUG] URL field of getBotCallbackAnswer is not processed
Opened this issue · 5 comments
Describe the bug
Based on official documentation of the keyboardButtonCallback, once a button is pressed by the user, the getBotCallbackAnswer method should be called. And there is a expected response of messages.botCallbackAnswer type. One of options is URL to the bot itself via URL field. However WebK version of Telegram client abandon this option while the same configuration works correctly on iOS and Desktop application.
To Reproduce
Steps to reproduce the behavior (here we assume you have a own bot to interact with Telegram client):
- Use a bot to send inlineKeyboard with keyboardButtonCallback.
- Click on the button
- Bot receives callback query
- Bot sends a response in a form of messages.botCallbackAnswer with
url
andhas_url
fields accordingly to documentation - Nothing happens on the client side
Expected behavior
Telegram client should switch the user to specified URL once messages.botCallbackAnswer received.
Desktop (please complete the following information):
- Linux
- Chrome
- Version 113
Additional context
After quick overview, I have found a WebK source code responsible for processing of message
field of the botCallbackAnswer. However there is nothing similar about url
field.
Update:
I also found this works in Web A, there is a piece of code where exactly url
field processed.
This will be implemented together with games.
I wonder if there is any roadmap or issue to track?
Also, just a feeling that this is a part related to bots functionality and partially to games. While other features related to bots working maybe it makes sense to treat it separately from games (sounds like a separate huge feature request).
Just as idea what need to be changed on line 4291 of buubles.ts.
if(typeof callbackAnswer.message === 'string' && callbackAnswer.message.length) {
toast(wrapRichText(callbackAnswer.message, {noLinks: true, noLinebreaks: true}));
} else if(typeof callbackAnswer.url === 'string' && callbackAnswer.url.length) {
window.open(callbackAnswer.url);
}
Just as idea what need to be changed on line 4291 of buubles.ts.
It's not that simple, see this. What do you need it for?
It's not that simple, see this.
Agree. I just was not aware if any similar implementation already exists in WebK version.
What do you need it for?
I want to build the following workflow for the bot:
- Bot send a message with inline button to Telegram group
- Telegram user presses the button
- Bot receives CallbackQuery event to provide initial processing
- Then based on results bot sets up a callbackAnswer to redirect user to DM with bot (Telegram API allows only this kind of URLs for callbackAnswer) to continue interaction.