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-userbot

v1.0.3

Published

n8n nodes for Telegram User Bot (MTProto) using GramJS - Send messages, import contacts, receive messages

Readme

n8n-nodes-telegram-userbot

n8n community node for Telegram User Bot (MTProto) using GramJS.

This package allows you to send messages, import contacts, and receive messages using your Telegram account (not a bot).

Features

  • Send Messages: Send text messages to any Telegram chat
  • Import Contacts: Import contacts by phone number and get their Telegram ID
  • Get Dialogs: List your chats and conversations
  • Receive Messages: Trigger workflows on incoming messages (with filters)

Installation

In n8n (Docker)

# Add to your n8n docker-compose.yml environment
N8N_COMMUNITY_PACKAGES=n8n-nodes-telegram-userbot

In n8n (npm)

cd ~/.n8n
npm install n8n-nodes-telegram-userbot

Development Install (from source)

cd ~/.n8n/custom
git clone <repository-url>
cd n8n-nodes-telegram-userbot
npm install
npm run build

Setup

1. Get Telegram API Credentials

  1. Go to my.telegram.org
  2. Log in with your phone number
  3. Click on "API development tools"
  4. Create a new application
  5. Save your API ID and API Hash

2. Generate Session String

The session string authenticates your Telegram account. Generate it once and use it in n8n:

cd n8n-nodes-telegram-userbot
npm install
npm run login

You'll be prompted for:

  • Your phone number (e.g., +989123456789)
  • Verification code (sent to your Telegram)
  • 2FA password (if enabled)

Copy the session string from the output.

3. Configure n8n Credentials

  1. In n8n, go to Credentials > New Credential
  2. Search for "Telegram User Bot API"
  3. Enter:
    • API ID: From my.telegram.org
    • API Hash: From my.telegram.org
    • Session String: From the login script

Usage

Send Message Node

Sends a text message to a Telegram chat.

Parameters:

  • Chat ID: Telegram chat ID (numeric) or @username
  • Message: Text message to send

Import Contact Node

Imports a contact by phone number and returns their Telegram ID.

Parameters:

  • Phone Number: Phone with country code (e.g., +989123456789)
  • First Name: Contact's first name
  • Last Name: Contact's last name (optional)

Returns:

  • userId: The Telegram user ID
  • success: Whether the contact was found on Telegram
  • username: Their username (if public)

Get Dialogs Node

Lists your recent chats.

Parameters:

  • Limit: Maximum number of chats to return

Trigger Node

Triggers on incoming messages.

Filters:

  • All Messages: Trigger on everything
  • Private Messages Only: Only direct messages
  • Group Messages Only: Only group/channel messages
  • Specific Chat: Only from one chat ID

Example Workflow: Phone to Telegram ID

[Manual Trigger]
    → [Telegram User Bot: Import Contact]
        → [IF: Check if imported]
            → [Postgres: Update lead with telegram_id]

Security Notes

⚠️ Keep your session string secure! Anyone with this string can access your Telegram account.

  • Store credentials in n8n's encrypted credential store
  • Never commit session strings to git
  • Generate new session if compromised (old sessions auto-invalidate)

Troubleshooting

"User not found on Telegram"

The phone number is not registered on Telegram or uses a different number.

"AUTH_KEY_UNREGISTERED"

Your session has expired. Generate a new one with npm run login.

"FLOOD_WAIT_X"

You're sending too many requests. Wait X seconds before retrying.

License

MIT