Socket
Book a DemoInstallSign in
Socket

n8n-nodes-telegram-bot-gridasov

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

n8n-nodes-telegram-bot-gridasov

n8n community node for Telegram with Bot API and MTProto API support. Includes two nodes: Telegram Bot (simple setup with Bot API) and Telegram MTProto (advanced setup that can receive ALL messages including from bots in groups).

latest
npmnpm
Version
5.0.11
Version published
Weekly downloads
97
-73.35%
Maintainers
1
Weekly downloads
 
Created
Source

n8n-nodes-telegram-bot

This is a community node for n8n that provides two nodes for working with Telegram:

  • Telegram Bot - uses Bot API (simple setup, limitations on messages from bots)
  • Telegram MTProto - uses MTProto API (complex setup, receives ALL messages including from bots)

Installation

  • Open n8n
  • Go to Settings > Community Nodes
  • Install package: n8n-nodes-telegram-bot-gridasov

Setup

Creating a Telegram bot

  • Find @BotFather in Telegram
  • Send the /newbot command
  • Follow the instructions to create a bot
  • Save the received token

Setting up credentials in n8n

  • In n8n, create new credentials of type "Telegram Bot API"
  • Enter your bot token in the "Bot Token" field
  • Test the connection

Usage

Basic workflow

  • Add a "Schedule Trigger" for periodic execution
  • Add a "Telegram Bot" node
  • Select "Get Updates" operation
  • Configure parameters:
    • Limit: number of messages to receive (default 100)
    • Offset: ID of the first update to receive
    • Timeout: timeout for long polling

Parameters

  • Limit: Maximum number of updates to receive (1-100)
  • Timeout: Timeout in seconds for long polling (0-50). Higher values reduce the number of API requests
  • Auto Confirm Updates: Automatically confirm received updates (recommended)
  • Include Bot Messages: Include messages from other bots in groups (requires disabling bot privacy)
  • Debug Mode: Enable debug information in output (shows API request details)

Example workflow

Schedule Trigger (every 5 minutes)
    ↓
Telegram Bot (Get New Updates)
    ↓
IF (check message type)
    ↓
Process messages

Automatic offset management

The node automatically tracks the last processed messages:

  • ✅ No need to manually configure offset
  • ✅ Automatically avoids message duplication
  • ✅ Preserves state between workflow runs
  • ✅ Confirms processed updates in Telegram

Data structure

When new messages are available:

{
  "update_id": 123456789,
  "message": {
    "message_id": 1,
    "from": {
      "id": 123456789,
      "is_bot": false,
      "first_name": "John",
      "username": "john_doe"
    },
    "chat": {
      "id": 123456789,
      "first_name": "John",
      "username": "john_doe",
      "type": "private"
    },
    "date": 1640995200,
    "text": "Hello, bot!"
  }
}

When no new messages are available:

{
  "message": "No new updates available",
  "last_offset": 123456790,
  "timestamp": "2025-07-16T08:30:00.000Z"
}

Receiving messages from bots in groups

⚠️ IMPORTANT LIMITATION: Telegram Bot API has server-side restrictions on receiving messages from other bots. This is a Telegram-level limitation and cannot be fully bypassed through Bot API.

What you can try:

  • Add your bot to a group with other bots
  • Disable bot privacy via @BotFather:
    • Send /mybots
    • Select your bot
    • Go to Bot Settings → Group Privacy
    • Select "Turn off"
  • Give the bot administrator rights in the group
  • Enable the "Include Bot Messages" option in the node settings

Alternative solutions:

  • Use the Telegram MTProto node (included in this package) - receives ALL messages
  • Webhook approach: Set up webhook instead of polling
  • Intermediate bot: Create a relay bot that forwards messages from other bots

Telegram MTProto (New node!)

🚀 Solution for bot messages problem

The Telegram MTProto node uses MTProto API and can receive ALL messages, including messages from other bots in groups.

MTProto setup

  • Get API credentials:

    • Go to https://my.telegram.org/apps
    • Log in with your phone number
    • Create a new application
    • Save the api_id and api_hash
  • Create credentials in n8n:

    • Type: "Telegram MTProto API"
    • API ID: your api_id
    • API Hash: your api_hash
    • Phone Number: your phone number (for initial authentication)
    • Session String: leave empty on first use
  • First run:

    • Authentication will be required on first run
    • Enable Debug Mode to get the session string
    • Save the session string in credentials for future use

Using MTProto node

Schedule Trigger (every 5 minutes)
    ↓
Telegram MTProto (Get Chat Messages)
    ↓
Process messages (including from bots!)

MTProto node parameters

  • Chat ID or Username: Chat ID or @username
  • Limit: Number of messages to receive
  • Offset ID: Message ID to start from (0 = latest)
  • Include Bot Messages: Include messages from bots (default true)
  • Debug Mode: Debug information

MTProto advantages

Receives ALL messages including from bots
No Telegram server limitations
More powerful API with extended capabilities
Works with any chats where you have access

MTProto disadvantages

Complex setup - requires API credentials
Authentication - requires phone number
More dependencies - uses telegram library

Troubleshooting

If messages from bots are not coming:

  • Enable "Debug Mode" in node settings to get debug information
  • Check bot settings via @BotFather with /mybots → select bot → Bot Settings
  • Ensure Group Privacy = OFF
  • Check bot permissions in the group (must be administrator)
  • Ask another bot to write a test message in the group

Testing API directly

You can test the API directly using a test script:

# Download test script
curl -O https://raw.githubusercontent.com/your-repo/test-telegram-api.js

# Run test
node test-telegram-api.js YOUR_BOT_TOKEN

Recommendations

  • Use timeout > 0 for long polling - this reduces API load
  • Keep Auto Confirm enabled - this prevents message reprocessing
  • Configure Schedule Trigger with an interval greater than timeout for optimal operation
  • Handle different types of updates (messages, callback queries, inline queries)
  • To receive messages from bots be sure to disable privacy via @BotFather

License

MIT

Keywords

n8n-community-node-package

FAQs

Package last updated on 11 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts