go-telegram-bot-api / telegram-bot-api

Golang bindings for the Telegram Bot API
https://go-telegram-bot-api.dev
MIT License
5.7k stars 879 forks source link

Not coming update with WebData after press main button. (Bot API 6.0) #556

Closed mazanur closed 2 years ago

mazanur commented 2 years ago

Hi. Im use master branch for testing telegram web app(this branch support telegram api version 6.0). By this guide https://habr.com/ru/post/666278/ i was able send button

tgbotapi.InlineKeyboardButton{Text: text, WebApp: &tgbotapi.WebAppInfo{URL: "https://b136-95-161-195-6.eu.ngrok.io/"}})

But just no matter what I do, I don't get Update Message with WebAppData.

After some times i tried telebot from python https://github.com/eternnoir/pyTelegramBotAPI and this code worked

def answer(webAppMes):
   print(webAppMes)
   print(webAppMes.web_app_data.data)
   bot.send_message(webAppMes.chat.id, f"get information from web app: {webAppMes.web_app_data.data}") 
mazanur commented 2 years ago

I resolve the problem using KeyboardButton built-in keyboard.