1

Please help me understand how to work with a web app from the client side (user, not a bot). There is a bot that uses a web app. Web app opens after pressing the inline button. The question is how to use telethon to interact with this web app (get a web page, perform some actions on it). I found in the documentation the following methods: https://tl.telethon.dev/methods/messages/request_app_web_view.html https://tl.telethon.dev/methods/messages/get_bot_app.html

But when I try to use them, I get the following error: error screenshot

As I guess the problem is in the wrong InputBotAppID. In this case, I use the data that I received from the bot entity as id and access_hash

Here is the code how i call one of these methods:

result = await client(functions.messages.RequestAppWebViewRequest(
                peer=bot_link,
                app=types.InputBotAppID(
                    id = 5434266369, #id from bot entity "id" field
                    access_hash= 872734024059711543 #access_hash from bot entity "access_hash" field
                ),
                platform='some string (idk what i should put here)'
            ))
            print(result.stringify())
Ivan
  • 11
  • 1
  • you're using the wrong request. for inline button web apps use [RequestWebViewRequest](https://tl.telethon.dev/methods/messages/request_web_view.html), once you get the final webview url with params, the rest is not related to telethon. pass peer and bot the same, platform can be 'android' or others, url= needs to be the url found the in the button of the message containing inline button – MustA Jul 27 '23 at 20:09

0 Answers0