# Auto-messages

The "Auto-message" node allows you to automatically send content blocks—to bot users or to channels/groups—based on a set timer. Two operating modes are supported: **User Timer** and **Global Timer**.

## Broadcast limits

### Daily limit

The total number of messages sent across all broadcasts (for all bots in the account) within a 24-hour period is capped at the **"Max users"** value specified in your pricing plan.

- The limit is listed in the "Plans" section and displayed directly within the "Auto-message" node editor, beneath the name field:
> *"Your daily broadcast limit depends on the bot user allowance for your plan and is set to **N** per day. Broadcasts in the last 24 hours: X (X%)"*
- Every successfully sent message counts towards this total.
- Once the limit is reached, all further broadcasts for the current day are halted—no auto_message nodes will trigger until the following day.
- If max_users = 0 (unset), the limit does not apply.

### Restrictions for free plans

Users **without a PRO plan** can trigger the **Global Timer** no more than **once every 24 hours**:

- In the node editor, the "Minutes" option for the interval unit is **unavailable**; yellow text appears instead:
> *"Free plans are limited to a minimum interval of 24 hours between runs."*
- If the node has already been triggered today, the next run will not occur until at least 24 hours have passed.
- This restriction applies only to the "Global Timer" (Broadcast / Posts). The "User Timer" operates normally. ---

## How to add

In the top-left corner of the builder, click the button with the **timer** icon (⏱) — this adds an "Auto-message" node to the canvas. The node appears with a dark red (crimson) design.

---

## Timer type

At the top of the node settings, select the mode:

- **User timer** — sends a message to a specific subscriber N hours/days after registration or last activity.
- **General timer (Broadcast / Posts)** — runs on a schedule: posting to channels/groups or a mass broadcast to users.

---

## User timer

### Delay countdown

Choose the starting point for the delay:

- **From registration time** — from the moment the user appears in the bot.
- **From last activity time** — from the moment of their last message (the "last_request" field).

### Delay

Specify the period: a value (1–9999) and a unit (hours / days).

For example, "1 day after last activity" means the auto-message will be sent to a user who has been inactive for more than 24 hours.

### Number of repeats

- **0** — send once.
- **N > 0** — repeat N additional times. The **"Interval between repeats"** field (hours / days) appears.

### User variable

Specify the variable name (e.g., **user**). Recipient data is available in blocks as "{{user.name}}", "{{user.chat_id}}", etc.

**Available fields:**

| Field              | Description                           |
|--------------------|---------------------------------------|
| "id"               | User ID in the bot                    |
| "chat_id"          | Telegram chat_id                      |
| "name"             | First name                            |
| "last_name"        | Last name                             |
| "login"            | Username (@)                          |
| "avatar"           | Avatar link (public storage URL)      |
| "phone"            | Phone                                 |
| "email"            | Email                                 |
| "sex"              | Gender                                |
| "city"             | City                                  |
| "lang"             | Language                              |
| "is_premium"       | Telegram Premium                      |
| "credits"          | Credits                               |
| "balance"          | Balance                               |
| "last_payment"     | Last payment                          |
| "pay_until"        | Subscription valid until              |
| "location"         | Geolocation                           |
| "address"          | Address                               |
| "date_birth"       | Date of birth                         |
| "time_birth"       | Time of birth                         |
| "place_birth"      | Place of birth                        |
| "last_request"     | Time of last request                  |
| "earn"             | Earned                                |
| "earn_from_ref"    | Earned from referrals                 |
| "last_free_credits"| Last free credit allocation           |
| "photos"           | Array of profile photo URLs           |
| "age"              | Age                                   |
| "bio"              | Bio                                   |
| "interests"        | Interests                             |
| "ban"              | Ban status                            |
| "tag"              | Tag                                   |
| "device"           | Device                                |

### Recipient filters

In the collapsed block You can limit the audience using "Recipient Filters."

| Filter                   | Values ​​/ Description                                                 |
|--------------------------|----------------------------------------------------------------------|
| First Name, Last Name, Username, Phone, Email, Geolocation, Address, City, Dates | All / Filled / Not filled |
| Gender                   | All / Male / Female                                                  |
| Telegram Premium         | All / Filled / Not filled                                            |
| Has payment              | All / Has payment / No payment                                       |
| Subscription until       | Text field; supports "{{$NOW.addDays(N).toDate()}}"                  |
| Active in last (days)    | Number of days (0 — no limit)                                        |
| Credits                  | Operator (>, ≥, =, ≤, <) + value                                     |
| Requests                 | Operator (>, ≥, =, ≤, <) + value                                     |
| Languages ​​               | Comma-separated list (**ru,en**)                                     |

> **$NOW expressions.** Date fields support the syntax "{{$NOW.toDate()}}", "{{$NOW.addDays(7).toDate()}}", "{{$NOW.subDays(1).toDate()}}", etc.

---

## General Timer

### Run every

Specify the execution interval: value + unit (minutes / hours). Minimum for minutes is **30**.

### Max runs

Limit the number of executions (0 — no limit). The counter resets when the node is deleted or recreated.

### Data source

#### Resources

Select one or more **connected channels and groups**. The node's blocks will execute sequentially for each resource.

If there are no resources, click "+ Connect" to navigate to the resources section.

The **resource variable** (e.g., **resource**) provides access to channel data within the blocks:

| Field        | Description                             |
|--------------|-----------------------------------------|
| "id"         | System resource ID                      |
| "chanel_id"  | Telegram channel/group ID               |
| "title"      | Title                                   |
| "image"      | Profile picture URL                     |
| "url"        | Resource link                           |
| "type"       | Type: "channel", "supergroup", "group"  |
| "users"      | Number of members                       |

> Usage example: "{{resource.title}}" — the channel title in the post text.

#### Users

Bulk messaging to all (or filtered) bot users on a schedule.

- **User variable** — the same fields as in "User Timer" mode (including extended ones).
- **Recipient filters** — the same ones, plus an additional filter: "Date of birth (exact match)":

The field accepts "{{$NOW.toDate()}}" — the message will be sent only to users whose birthday is today.

- **Send only once to each user** (enabled by default) — the user receives the message only once, even if the timer runs again.

### Schedule Type (Calendar Mode)

When the **Calendar** schedule type is selected in **Users** mode, additional settings become available:

#### Individual schedule

If enabled, each user receives the message at their personal scheduled time rather than at a globally set time.

**Schedule type** — the slug identifier for the schedule entry, e.g., `morning` or `evening`.

If the **Schedule type** field is left blank, the legacy behavior applies: using the `preferred_time` and `preferred_days` fields from the user profile.

> Manage schedule entries via the **Database** block → **User Schedules** source (actions: create/update, get, delete). #### Multiple messages at different times

Create multiple "Automated Message" nodes with different schedule types:
- Node 1: `morning` type → morning message
- Node 2: `evening` type → evening message

Each user can have their own specific time for each type.

---

## Content blocks

The "Automated Message" node supports the same blocks as the "Command" node: text, images, video, conditions, API requests, transitions, etc.

> **Note:** The "Send to another" block is not supported in automated messages; it is automatically hidden.

In **Global Timer → Resources** mode, you must select at least one resource before adding blocks.

---

## Actions

At the bottom of the automated message editor, there is an **Actions** section with the following setting:

### Next step

The command the scenario will transition to **after the automated message is sent** if the user sends any message or file to the bot (provided the automated message itself does not contain buttons directing the user to a different node).

- Only nodes of the **Command** type are available in the dropdown list.
- If the field is empty, the automated message acts as the scenario's endpoint, and no automatic transition occurs.
- The connection is displayed on the canvas as a dashed line labeled "After sending"—this connection can also be created by dragging from the output.