N8N Tools Telegram icon

N8N Tools Telegram

Interact with Telegram Bot API

Overview

This node integrates with the Telegram Bot API to perform various bot-related operations. Specifically, for the Bots resource and the Set My Name operation, it allows you to change the display name of your Telegram bot. This can be useful when you want to update your bot's identity or branding without creating a new bot.

Common scenarios include:

  • Updating the bot's name to reflect a rebranding or new purpose.
  • Localizing the bot's name by setting it in different languages using optional parameters.
  • Automating bot management workflows where the bot's name needs to be changed dynamically based on external triggers.

Example: Automatically rename your Telegram bot to "SupportBot" during business hours and revert to "InfoBot" after hours.

Properties

Name Meaning
Options Additional options as a JSON object. For "Set My Name", this typically includes language_code to specify the language for the new name.

The node expects the following input properties relevant to the Bots - Set My Name operation:

  • name (string, required): The new name to set for the bot.
  • options (JSON, optional): Additional options such as language code to localize the bot name.

Note: The provided user properties JSON only included the "Options" property, but the code shows that the "name" parameter is also required for this operation.

Output

The output is a JSON object representing the response from the Telegram Bot API for the "setMyName" method. It typically contains information about the success of the operation or details of the updated bot name.

No binary data output is involved in this operation.

Example output structure (simplified):

{
  "ok": true,
  "result": {
    "name": "New Bot Name",
    "language_code": "en"
  }
}

Dependencies

  • Requires an active Telegram Bot API token configured via credentials.
  • Requires a valid subscription and API key for the "N8N Tools API" service, which validates usage before forwarding requests to Telegram.
  • The node uses the internal Telegram API wrapper (TelegramApi) to interact with Telegram endpoints.
  • No additional environment variables are explicitly required beyond standard n8n credential setup.

Troubleshooting

  • Invalid subscription or API key error: If the node throws an error indicating invalid subscription or API key, verify that the API key credential for the N8N Tools API is correctly configured and active.
  • Unknown operation error: Ensure the operation selected matches the supported operations for the Bots resource; "setMyName" must be spelled exactly.
  • Malformed JSON in options: The "Options" property must be valid JSON if used; otherwise, parsing errors may occur.
  • Missing required parameters: The "name" parameter is mandatory for this operation; ensure it is provided.

Links and References

Discussion