Closed oldmh closed 1 year ago
WebApp features are not supported yet. I added only few API 6.0 features that people requested a while ago.
@MykhailKacha I would like to implement this for you. But how can I call Telegram.WebApp.sendData? I never did a WebApp and would need your help to be able to reproduce/test it.
In my theory the bot will receive a message of a new type like SentWebAppMessage.
I am interested in this feature too. Note: a catch-all-the-updates node would be amazing to configure new features without waiting for them to be implemented here :)
By the way: 1- create a web app that sends a message back:
<script src="https://telegram.org/js/telegram-web-app.js"></script>
<script>
window.Telegram.WebApp.sendData("SNADO");
</script>
2- upload it to a public web server ( https://example.com/test.html ) 3- send a message to the user showing a custom inline keyboard:
msg.payload={
reply_to_message_id: msg.payload.messageId,
type: "message",
content: "Managing stuff..",
chatId: 1234567890,
options: {
reply_markup: JSON.stringify({
keyboard:[
[
{
"text": "Managing stuff..",
"web_app": {
"url":"https://example.com/test.html?"+Math.random()
}
}
]
]
})
}
};
4- Just press on the gigantic "Managing stuff.." button 5- The bot will receive a Message object ( https://core.telegram.org/bots/api#message ) containing the WebAppData optional object populated ( https://core.telegram.org/bots/api#webappdata ) 6- Enjoy ?
@ShotokanZH thanks alot... exactly what I was looking for
please try 14.1.0 the message type is web_app_data and can be received using the receiver node
Amazing work man!
Hello, cannot find any event that catches Telegram.WebApp.sendData.
I was developing a webpage to include it into my bot using webapp feature. I had a button, that sends data onclick to bot.
After click on the button telegram sends a message that I have passed data to bot
So, I am not sure that this feature is already implemented, but I saw that you have added a support for API 6.0.0 version that contains WebApp support.
So, if I have missed something or this feature is not implemeted, please answer me in the issue.
Thank you for your library. Have a nice day.