npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-telegram-bot-gridasov

v5.0.11

Published

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).

Downloads

4,400

Readme

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

  1. Open n8n
  2. Go to Settings > Community Nodes
  3. Install package: n8n-nodes-telegram-bot-gridasov

Setup

Creating a Telegram bot

  1. Find @BotFather in Telegram
  2. Send the /newbot command
  3. Follow the instructions to create a bot
  4. Save the received token

Setting up credentials in n8n

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

Usage

Basic workflow

  1. Add a "Schedule Trigger" for periodic execution
  2. Add a "Telegram Bot" node
  3. Select "Get Updates" operation
  4. 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:

  1. Add your bot to a group with other bots
  2. Disable bot privacy via @BotFather:
    • Send /mybots
    • Select your bot
    • Go to Bot Settings → Group Privacy
    • Select "Turn off"
  3. Give the bot administrator rights in the group
  4. 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

  1. 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
  2. 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
  3. 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:

  1. Enable "Debug Mode" in node settings to get debug information
  2. Check bot settings via @BotFather with /mybots → select bot → Bot Settings
  3. Ensure Group Privacy = OFF
  4. Check bot permissions in the group (must be administrator)
  5. 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

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

License

MIT