> ## Documentation Index
> Fetch the complete documentation index at: https://docs.skyfree.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Telegram Triggers

> The triggers available for Telegram automations — bot commands and new group members — plus how a Telegram message is routed.

## What is this?

Telegram automations can use the generic triggers covered in [Triggers](/workspace/automation/triggers/overview), plus two of their own: **Command received** and **Someone joins the group**.

Create the automation on your Telegram channel. The builder then shows Telegram triggers and [Telegram steps](/workspace/automation/steps/telegram-steps).

## What can I do here?

| Trigger                             | Runs when…                                                                       |
| ----------------------------------- | -------------------------------------------------------------------------------- |
| **Message Received**                | A message matches your keywords — including the label of a button someone tapped |
| **New Conversation**                | Someone starts a new private chat with the bot (doesn't run for groups)          |
| **No Match Reply**                  | A message matches nothing else                                                   |
| **Contact or Custom Field Changed** | A selected contact or custom field changes                                       |
| **Pipeline Stage Changed**          | A contact is added to or moved within a pipeline                                 |
| **Command received**                | Someone sends a bot command such as `/pricing`                                   |
| **Someone joins the group**         | A new member joins a group your bot is in                                        |

The first five work exactly as described on their own pages. The last two are Telegram-only.

## How to use it

### Command received

Runs when a person sends a command to your bot, for example `/pricing`, `/help`, or `/start`.

1. Create a workflow on your Telegram channel and choose **Command received**.
2. In **Command**, type the command **without the slash**, for example `pricing`. Leave it blank (or `*`) to run for **any** command.
3. Add the steps that answer.

Use these variables in later steps:

| Variable                    | Contains                                                                 |
| --------------------------- | ------------------------------------------------------------------------ |
| `{{telegram.command}}`      | The command that was sent                                                |
| `{{telegram.command_args}}` | Anything typed after the command, for example `/pricing pro` gives `pro` |

To add a command to the bot's menu in Telegram, see [Bot Settings](/workspace/telegram/bot-settings#bot-commands).

<Note>
  A command is handled first, before keyword and AI replies. If a **Command received** automation for `/start` is active, it answers instead of the [welcome message](/workspace/telegram/bot-settings#welcome-message).
</Note>

### Someone joins the group

Runs when a new member joins a group your bot is in — a good place for a custom welcome or rules reminder.

Variables: `{{telegram.joined_names}}` (the new members' names) and the `{{telegram.sender_*}}` details. Pair it with the **Group Action** step to moderate. See [Groups](/workspace/telegram/groups).

### Buttons

There's no separate "button clicked" trigger. A button tap arrives as a normal message from the person, with the button's label as its text:

1. A flow that's **waiting** on that button continues first.
2. Otherwise it's handled by **Message Received**, so a keyword on the button's label matches it.

### How a Telegram message is routed

1. A **command** starts its **Command received** automation.
2. Anything else — including button taps — goes through: a **running flow**, then **keyword automations**, then the **AI agent**, then **No Match Reply**.

## Telegram variables

Available in every step of a Telegram automation:

| Variable                                                                             | Contains                           |
| ------------------------------------------------------------------------------------ | ---------------------------------- |
| `{{telegram.userId}}`                                                                | The person's Telegram ID           |
| `{{telegram.chatId}}`                                                                | The chat's ID                      |
| `{{telegram.username}}`                                                              | Their @username, if they have one  |
| `{{telegram.firstName}}` and `{{telegram.lastName}}`                                 | Their name                         |
| `{{telegram.languageCode}}`                                                          | Their Telegram language            |
| `{{telegram.callback_data}}`                                                         | The data of the button they tapped |
| `{{telegram.is_group}}`                                                              | Whether the chat is a group        |
| `{{telegram.sender_id}}`, `{{telegram.sender_username}}`, `{{telegram.sender_name}}` | Who sent the message, in a group   |

## Troubleshooting / Technical Notes

* **A command does nothing.** Check the automation is **Active** and on the Telegram channel, and the command matches exactly, without the slash. Leave it blank to catch all.
* **My keyword automation runs on a command.** Commands are handled first. Use **Command received** instead.
* **New Conversation doesn't run in a group.** By design — groups don't fire it. Use **Someone joins the group** or Message Received.
* **A button tap isn't caught.** Add a keyword on the button's exact label to **Message Received**, or build the reply as a waiting **Buttons** step.
* **The trigger isn't in the list.** It only appears on Telegram automations.

## Related docs

* [Triggers](/workspace/automation/triggers/overview)
* [Telegram Steps](/workspace/automation/steps/telegram-steps)
* [Bot Settings](/workspace/telegram/bot-settings)
* [Groups](/workspace/telegram/groups)
