gram-js / gramjs

NodeJS/Browser MTProto API Telegram client library,
MIT License
1.25k stars 178 forks source link

How to open webview app #683

Closed canyesilyurt closed 4 months ago

canyesilyurt commented 4 months ago

Hello, how do I open an application from telegram as a webview?

Example python code: `

from telethon.sync import TelegramClient
from telethon.sync import functions, types, events
return await client(
    functions.messages.RequestWebViewRequest(
        peer='tapswap_bot',
        bot='tapswap_bot',
        platform='ios',
        from_bot_menu=False,
        url='https://app.tapswap.ai/',
    )
)

`

canyesilyurt commented 4 months ago

Solved:

`

const result = await client.invoke( new Api.messages.RequestWebView({ peer: await client.getInputEntity('tapswap_bot'), bot: 'tapswap_bot', platform: 'ios', url: 'https://app.tapswap.ai/', }) ); `