N8N Tools Telegram icon

N8N Tools Telegram

Interact with Telegram Bot API

Overview

The node integrates with the Telegram Bot API to perform various chat-related operations. Specifically, for the "Chats" resource and the "Restrict Chat Member" operation, it allows you to restrict a member's permissions within a Telegram chat. This is useful in scenarios where you want to limit what a user can do in a group or channel, such as muting them temporarily or restricting their ability to send messages or media.

Practical examples include:

  • Temporarily muting a disruptive user in a group chat.
  • Restricting new members from posting links or media until they are verified.
  • Applying custom restrictions based on chat rules automatically via workflows.

Properties

Name Meaning
Chat ID The unique identifier for the target Telegram chat where the restriction will be applied.
User ID The unique identifier of the Telegram user to restrict in the specified chat.
Options Additional optional parameters for the restriction operation (e.g., duration, permissions).

Output

The output is a JSON object representing the response from the Telegram Bot API after attempting to restrict the chat member. It typically contains information about the success or failure of the operation and any relevant data returned by the API.

If the operation fails and "Continue On Fail" is enabled, the output JSON will contain an error field with the error message.

This node does not output binary data.

Dependencies

  • Requires an active Telegram Bot API token configured as credentials in n8n.
  • Requires a valid subscription and API key for the external "N8N Tools API" service used for validation before making Telegram API calls.
  • The node uses HTTP requests to communicate with both the N8N Tools API and the Telegram Bot API.

Troubleshooting

  • Invalid Subscription or API Key: If the node throws an error indicating invalid subscription or API key, verify that your API key credential for the external validation service is correct and active.
  • Permission Errors: Telegram may reject the restriction if the bot lacks admin rights in the chat or if the user ID is invalid. Ensure the bot has appropriate permissions.
  • Malformed Options: The "Options" property expects a JSON object. Invalid JSON or incorrect permission structures may cause errors.
  • Unknown Operation Error: If the operation name is incorrect or unsupported, the node will throw an "Unknown operation" error.
  • Continue On Fail Behavior: When enabled, errors for individual items will be captured in the output JSON under an error field instead of stopping execution.

Links and References

Discussion