Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^\/start ([a-zA-Z0-9_-]{1,64})$
/
g

Description

Telegram bot deep linking

Telegram bots have a deep linking mechanism, that allows for passing additional parameters to the bot on startup. It could be a command that launches the bot — or an auth token to connect the user's Telegram account to their account on some external service.

Each bot has a link that opens a conversation with it in Telegram — https://telegram.me/<bot username>

You can add the parameters start or startgroup to this link, with values up to 64 characters long. For example: https://telegram.me/triviabot?startgroup=test

A-Z, a-z, 0-9, _ and - are allowed. your bot will receive a message from that user in this format: /start PAYLOAD

Submitted by SadeghPM@gmail.com - 8 years ago