Special links - LonamiWebs/Telethon GitHub Wiki

There are certain link types that are recognised by the official Telegram applications and cause them to perform certain actions. While Telethon currently offers no way to parse and react to these, they may still be useful to know, so that you can make use of them if you develop an application (like a bot).

HTTP links:

  • https://t.me/bot?start=foo. Starts @bot with parameter foo. Note that the maximum length for the start command is 64 alphanumerical characters.
  • https://t.me/share/url?url=foo. Lets the user select a chat and have their input be foo.
  • https://t.me/c/chat_id/msg_id. Opens the chat with ID chat_id and highlights the message with ID msg_id. Note that the msg_id doesn't seem optional. Note that the chat must be a channel (megagroup or broadcast).

Links documented under @DeepLink:

With any of those URLs, the following paths may be used:

  • joinchat/

  • addstickers/

  • iv/

    • url
    • rhash
  • msg/, share/ and share/url

    • url
    • text
  • confirmphone

    • phone
    • hash
  • start

  • startgroup

  • game

  • socks, proxy

    • server (address)
    • port (port)
    • user (user)
    • pass (password)
    • secret (secret)
  • setlanguage/

    • (up to 12 characters)
  • bg

    • slug
    • mode
    • intensity
    • bg_color

TG links:

Links documented under @DeepLink:

  • tg://resolve

    • domain: username to resolve. If the domain is telegrampassport, see tg://passport for parameters.
    • start: start parameter to use in a private conversation with the bot.
    • startgroup : start parameter to use in a group with the bot.
    • game: undocumented.
    • post: undocumented.
  • tg://join

  • tg://addstickers

  • tg://msg, tg://share and tg://msg_url

    • url: the text (or URL) to share.
    • text: extra text to share (placeholder), selected to be changed.
  • tg://confirmphone

    • phone: undocumented.
    • hash: undocumented.
  • tg://openmessage

    • user_id: undocumented.
    • chat_id: undocumented.
    • message_id: the ID of the message to focus.
  • tg://passport

    • bot_id: undocumented.
    • scope: undocumented.
    • public_key: undocumented.
    • callback_url: undocumented.
    • nonce: undocumented.
    • payload: undocumented.
  • tg://proxy and tg://socks

    • server: address of the proxy to connect to.
    • port: port used by the proxy server.
    • user: user name credentials.
    • pass: user password credentials.
    • secret: the secret for this MTProto proxy.
  • tg://need_update_for_some_feature

  • tg://some_unsupported_feature

  • tg://user

    • id: the ID of the user to mention.
  • tg://share_game_score (and?) tg://gshare

    • hash: undocumented.
  • tg://filename (?)

  • tg://login

    • code: the code sent by Telegram to login.
  • tg://bg

    • slug: undocumented.
    • mode: undocumented.
  • tg://search_hashtag (Telegram Web/Telegram React)

    • hashtag: the hashtag to search for.
  • tg://bot_command (Telegram Web/Telegram React)

    • command: the command to use.
    • bot: undocumented.
  • tg://unsafe_url (Telegram Web)

    • url: the underlying URL to access to.

More can be found in tdesktop's click_handler_types.cpp or local_url_handlers.cpp.

The links/urls might be platform-/client-specific and as such might not work on every client. If you really need to use some special link make sure it works on all platforms.