All nodes/Integrations/Telegram
Telegram Moderate
Chat moderation: delete messages, ban/unban, mute/unmute, grant or revoke admin rights, pin/unpin. The bot must be an administrator holding the matching right (can_delete_messages / can_restrict_members / can_pin_messages). Own messages can only be deleted under 48 hours old; delete_messages is sent in batches of 100. Supports dry_run. Requires a Telegram Config.
Type in the graph: telegram_moderate
Exec
An error branch can be enabled (expose_error_output) to handle failures on their own path.
Try it
Minimal working workflow
- Execute
- Execute + Data
Runs as pasted
When to use it
This node acts on people and messages: delete, ban, mute, grant or revoke admin rights, pin and unpin. Settings of the chat itself — title, invites, read-only mode — live in the sibling node Manage Chat. When the decision belongs to a model rather than the graph, use Telegram Tools, which exposes the same actions behind an explicit allowlist.
How it works
The bot must be an administrator holding the matching right: can_delete_messages,
can_restrict_members, can_pin_messages. Chat Info
can check that in advance with its bot-rights action.
Every real action writes an audit record, and deleted messages are marked in the recorded group history, so Group History stops returning them.
Common mistakes
- 48 hours for the bot’s own messages. The bot can delete its own message only while
it is under two days old; anyone else’s needs
can_delete_messages. affectedon a bulk delete counts ids submitted, not messages removed. Ids go out in batches of 100 and Telegram skips the too-old ones silently, without an error.- A bulk delete fails on the first refusal. How much went through beforehand is
unknowable, so the node stops and
affectedis not reported on that path. - Duration 0 means forever. And Telegram also reads any positive value under about 30 seconds as forever, so the platform raises it to 31 seconds — otherwise “mute for 10 seconds” would become a permanent mute.
- Muting works in supergroups only. Telegram does not let a bot restrict a member of a plain group.
- Granting admin rights is deliberately bounded. The right to promote further admins
(
can_promote_members) is never granted, so a bot cannot mint administrators. - Dry run does not check rights. It returns the plan without calling Telegram, so a green dry run proves nothing.
- A refusal stops the node rather than arriving as a
success: falsefield. Turn on the error output when a refusal should be handled by a branch. - Unpin with a blank Message ID unpins the most recently pinned message.
Inputs
| Port | Wire | Payload | Notes |
|---|---|---|---|
Telegram Configtelegram_config | Datadata | — | shown when connection_source ≠ "auto" |
Outputs
| Port | Wire | Payload | Notes |
|---|---|---|---|
Successoutput | Execute + Dataexecute_data | object | |
Erroron_error | Execute + Dataexecute_data | — | shown when expose_error_output = true |
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
Connection sourceconnection_source | string | auto | Where this node gets its connection. 'From the run context' uses what the platform already knows (the Telegram bot this workflow is deployed to / this workspace's own file store) and needs no wiring. 'External connection' shows the resource port so a config node can be wired into it. Options: |
Actionaction | string | unpin | Requires the bot to be an administrator. delete_message/delete_messages — deletion (own messages only under 48 hours old; other people's only with can_delete_messages); ban/unban — bans; restrict/unrestrict — mute/unmute; promote/demote — admin rights; pin/unpin/unpin_all — pinned messages. Options: |
Chat IDchat_id | string | "" | Numeric Telegram chat_id (an @username is not accepted here). Blank = the chat of the running Telegram turn. Templates are supported. supports templates |
Silentdisable_notification | boolean | false | Pin without notifying the members. shown when action = pin |
Dry rundry_run | boolean | false | Do not call Telegram — only report what would have been done. The safe way to debug a moderation branch. |
Duration (seconds)duration_seconds | integer | 0 | How long the ban/mute lasts. 0 = forever. Telegram treats anything under 30 seconds or over 366 days as forever. shown when action = ban | restrict |
Message IDmessage_id | string | "" | Numeric id of the message to act on. Templates are supported, e.g. {{ nodes.send_message_1.message_id }}. Required for delete_message and pin; for unpin it is optional — blank unpins the most recently pinned message. supports templates shown when action = delete_message | pin | unpin |
Message IDsmessage_ids | string | "" | Comma-separated ids or a JSON array. Sent in batches of 100 (the Bot API limit); ids older than 48 hours are silently skipped by Telegram. supports templates shown when action = delete_messages |
Delete their messagesrevoke_messages | boolean | false | When banning, also delete every message the user posted in the chat. shown when action = ban |
User IDuser_id | string | "" | Numeric Telegram user_id. Templates are supported. supports templates shown when action = ban | unban | restrict | unrestrict | promote | demote |
Shared fields
Every node has these three — the platform adds them, not the node author.
expose_error_output— When enabled, show an execution output to connect nodes that run if this step fails.