On the documentation page of Telegram's Web Apps we can read this:
Direct Link Web Apps
You can use direct links to open a Web App directly in the current chat. If a non-empty startapp parameter is included in the link, it will be passed to the Web App in the start_param field and in the GET parameter tgWebAppStartParam.
In this mode, Web Apps can use the chat_type and chat_instance parameters to keep track of the current chat context. This introduces support for concurrent and shared usage by multiple chat members – to create live whiteboards, group orders, multiplayer games and similar apps.
Web Apps opened from a direct link have no access to the chat – they can't read messages or send new ones on behalf of the user. To send messages, the user must be redirected to inline mode and actively pick a result.
Examples
https://t.me/botusername/appname https://t.me/botusername/appname?startapp=command
So, where we can get the appname? Does anybody can explain? Thanks.
If you want to create a t.me
link to automatically open the WebApp, you'll need to register the app with the @BotFather:
/newapp
commandGood! Now please choose a short name for your web app: 3-30 characters,
a-zA-Z0-9_
. This short name will be used in URLs liket.me/some_bot/myapp
and serve as a unique identifier for your web app.
You can now use
testapp
as the short_name parameter value in Bot API. Your web app link ist.me/some_bot/testapp
. Open it to start developing your web app!