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

v2.0.7

Published

Telegram Censor for n8n: local nudity detection and blur to prevent Telegram channel/group bans from adult content

Readme

Telegram Censor Banner

🔒 Telegram Censor - n8n Content Moderation Node

Protect Your Telegram Channel or Group from Ban - AI-Powered Nudity Detection & Blur for n8n Workflows

Build Status Publish Status Socket Badge GitHub Issues GitHub Pull Requests

npm version npm downloads/week npm downloads/month npm downloads/year node version npm license GitHub license npm total downloads npm unpacked size npm types npm collaborators

github stars github forks last commit GitHub contributors GitHub watchers GitHub issues closed GitHub PRs closed Commit activity Repo size Code size Top language

telegram dependency sharp dependency onnxruntime-web dependency n8n-workflow peer dependency

Telegram API TypeScript n8n pnpm >= 9.1 Node >= 18.17 AI: Local Only


🚨 Is Your Telegram Channel or Group at Risk of Ban?

Telegram has strict policies against adult and pornographic content. One accidental upload can result in your channel being banned with this message:

⚠️ "This channel can't be displayed because it was used to spread pornographic content."

This is the dreaded Telegram channel ban message that thousands of channel and group owners face every day. Don't let this happen to you!


🛡️ Why You Need Telegram Censor

Daily Scenarios That Put Your Channel at Risk:

| Scenario | Risk Level | How Telegram Censor Helps | | --------------------------------- | ---------- | ------------------------------------------------ | | 🤖 Automated Posting Mistakes | 🔴 HIGH | Scans all auto-posted images before they go live | | 📅 Scheduled Content Errors | 🔴 HIGH | Validates scheduled posts for policy compliance | | 🔄 Bot Forwarded Media | 🟠 MEDIUM | Filters incoming bot messages for adult content | | 👥 User-Generated Content | 🔴 HIGH | Moderates member submissions automatically | | 📤 Bulk Upload Accidents | 🔴 HIGH | Batch scans multiple images before posting | | 🔄 Reposted Old Content | 🟠 MEDIUM | Re-scans previously shared media for compliance |

What Happens When Telegram Bans Your Channel:

  • Channel becomes inaccessible to all subscribers
  • All content is hidden and cannot be recovered
  • Subscriber count drops to zero instantly
  • Reputation damage that takes months to rebuild
  • Business loss if you monetize your channel
  • No appeal guarantee - bans are often permanent

🎯 Telegram Censor - Your Content Safety Net

Telegram Censor is a powerful n8n custom node that uses local AI (NudeNet) to automatically detect and blur adult content before it triggers Telegram's enforcement systems. 100% private, 100% local, 100% free forever.

🌟 Key Features

🧠 AI-Powered Content Detection

  • Local NudeNet AI - Detects exposed body parts using ONNX model
  • 18 Detection Classes - Covers all sensitive areas
  • Adjustable Confidence - Set your own sensitivity threshold
  • 100% Offline - No data ever leaves your server

🎨 Smart Blur Technology

  • Precision Blur - Only blurs detected sensitive regions
  • Adjustable Strength - Control blur intensity (0-100)
  • Original Quality - Non-sensitive areas remain crisp
  • Automatic Replacement - Seamlessly replaces original media

📱 Telegram MTProto Integration

  • User Session Support - Authenticate with your Telegram account
  • Message Management - Get, download, and replace media
  • Time-Based Filters - Scan recent messages or date ranges
  • Media Type Filters - Focus on photos, videos, or documents

🔒 Privacy First

  • Zero External APIs - Everything runs locally
  • No Data Upload - Images never leave your server
  • Self-Hosted AI - Included NudeNet model (ONNX)
  • GDPR Compliant - No third-party data sharing

📦 Installation

Method 1: n8n Community Nodes (Recommended)

  1. Open n8n UI
  2. Go to SettingsCommunity Nodes
  3. Search for: n8n-nodes-telegram-censor
  4. Check the box to allow external nodes
  5. Click Install
  6. Restart n8n to load the custom node

Method 2: npm Installation

npm install n8n-nodes-telegram-censor

Method 3: Manual Installation

# Clone to n8n custom nodes directory
git clone https://github.com/sadiakant/n8n-nodes-telegram-censor.git

# Install dependencies
npm install

# Build the project
npm run build

# Restart n8n

⚙️ Quick Setup

1. Get Telegram API Credentials

2. Generate Session String

💡 Pro Tip: Use our Telegram GramPro node to easily generate session strings!

Follow our Authorization Guide for detailed instructions on generating your session string.

3. Configure Credentials

In n8n → Settings → Credentials:

  • API ID: Your Telegram API ID
  • API Hash: Your Telegram API hash
  • Session String: Your generated session string

🚀 Available Operations

| Operation | Description | Use Case | | --------------------- | ------------------------------------------- | ---------------------------------- | | 📥 Get Messages | Fetch messages with time/date/media filters | Scan recent posts for compliance | | 💾 Download Media | Download photos from messages | Extract images for analysis | | 🔍 Scanner | AI nudity detection with confidence scoring | Identify policy-violating content | | 🎨 Blur | Apply blur to detected regions | Make content safe for Telegram | | 🔄 Replace Image | Replace media in existing messages | Update posts with blurred versions |


📋 Content Moderation Workflow Examples

Basic Protection Workflow

1. Schedule Trigger (Daily/Hourly)
   ↓
2. Telegram Censor (Get Messages - Last 24 Hours)
   ├── Filter: Only Media = true
   └── Media Type: Photo
   ↓
3. Telegram Censor (Download Media)
   ↓
4. Telegram Censor (Scanner)
   ├── Confidence: 0.4 (40%)
   └── Output: isNsfw, detections
   ↓
5. IF isNsfw = true
   ├── Telegram Censor (Blur)
   │   └── Blur Strength: 35
   └── Telegram Censor (Replace Image)
       └── Replace with blurred version
   ↓
6. Send Notification (Optional)
   └── "X images were auto-censored for policy compliance"

Real-Time Protection Workflow

1. Telegram Trigger (New Message with Media)
   ↓
2. Telegram Censor (Download Media)
   ↓
3. Telegram Censor (Scanner)
   ↓
4. IF NSFW Detected
   ├── Blur Image
   ├── Replace in Message
   └── Notify Admin: "Adult content auto-blurred"
   ↓
5. IF Safe
   └── Continue normally

Batch Cleanup Workflow

1. Manual Trigger (Channel Audit)
   ↓
2. Telegram Censor (Get Messages - Date Range)
   ├── From: 2026-01-01
   └── To: 2026-12-31
   ↓
3. Loop Through Messages
   ├── Download Media
   ├── Scan for Nudity
   ├── IF Violation Found
   │   ├── Blur Image
   │   ├── Replace Original
   │   └── Log Violation
   └── Continue Loop
   ↓
4. Generate Report
   └── "Audit complete: X images processed, Y blurred"

🔍 AI Detection Classes

Unsafe Classes (Auto-Flagged):

| Class | Description | Risk Level | | -------------------------- | ------------------------ | ----------- | | FEMALE_GENITALIA_EXPOSED | Exposed female genitalia | 🔴 Critical | | MALE_GENITALIA_EXPOSED | Exposed male genitalia | 🔴 Critical | | FEMALE_BREAST_EXPOSED | Exposed female breasts | 🔴 Critical | | MALE_BREAST_EXPOSED | Exposed male breasts | 🟠 High | | BUTTOCKS_EXPOSED | Exposed buttocks | 🔴 Critical | | ANUS_EXPOSED | Exposed anus | 🔴 Critical |

Additional Detection Classes:

  • Covered genitalia, breasts, buttocks
  • Face detection (male/female)
  • Armpits, belly, feet

⚡ Performance & Memory Optimization

Telegram Censor is optimized for low-memory environments:

| Optimization | Benefit | | --------------------------- | ------------------------- | | Disabled Sharp Cache | Prevents memory bloat | | Zero-Copy Normalization | Saves 1.2MB per image | | CHW Buffer Pooling | Reuses memory buffers | | Lazy Model Loading | Loads AI only when needed | | Aggressive Cleanup | Releases memory after use |

Memory Usage:

  • At Rest: ~50 MB
  • During Scan: ~150-200 MB
  • Model Cached: ~100 MB

📊 Configuration Options

Scanner Settings:

{
	"minConfidence": 0.4 // 0.0 - 1.0 (lower = more sensitive)
}

Blur Settings:

{
	"blurStrength": 35 // 1 - 100 (higher = more blur)
}

Replace Image Settings:

{
	"editMediaUrl": "", // If set, replace media from URL
	"editZeroMedia": false, // true = remove media from message
	"editText": "Updated text or caption"
}

Replace behavior priority:

  1. If editMediaUrl is provided -> replace media from URL
  2. Else if editZeroMedia = true -> remove media (retries on Telegram API rejection)
  3. Else -> replace using input binary (prefers media, otherwise first available binary field)
  4. If none of the above are available -> update text/caption only

🛡️ Security & Privacy

100% Local Processing:

  • ✅ AI model runs on your server
  • ✅ No image data sent to external APIs
  • ✅ No cloud processing or storage
  • ✅ No telemetry or analytics
  • ✅ Fully auditable code

Data Protection:

  • Session strings are encrypted at rest
  • No logging of image content
  • Temporary file cleanup
  • GDPR and privacy compliant

🚨 Troubleshooting

For common issues and solutions, see our Troubleshooting Guide.

Quick Fixes:

| Issue | Solution | | ------------------- | ---------------------------------- | | "Model not found" | Run npm run build to copy assets | | "Out of memory" | Enable debug logs to monitor usage | | "Connection failed" | Check session string validity | | "Blur too weak" | Increase blurStrength parameter | | "False positives" | Increase minConfidence threshold |


📝 Logging

Enable debug logging to monitor memory usage:

# Set environment variable
export N8N_LOG_LEVEL=debug

# Or in n8n settings
# Settings → Log Level → Debug

Memory logs will show:

[Memory] Pre-Load: 45.23 MB
[Memory] Post-Load: 145.67 MB
[Memory] Unloaded: 52.11 MB

📖 Documentation


🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup:

# Clone repository
git clone https://github.com/sadiakant/n8n-nodes-telegram-censor.git

# Install dependencies
npm install

# Build project
npm run build

# Test changes
npm run dev

📄 License

MIT License - see LICENSE file for details.


🔗 Resources


⚠️ Disclaimer

Telegram Censor is designed to help content creators comply with Telegram's policies. It does not guarantee 100% detection accuracy. Always review critical content manually.

  • This tool is for content moderation and policy compliance
  • False positives and negatives are possible with any AI system
  • Users are responsible for ensuring their content complies with Telegram's Terms of Service
  • The developers are not responsible for channel bans or content violations

💬 Support


👥 Contributors

| Agent | Expertise & Role | | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------- | | | Krushnakant Sadiya Project Lead • Architecture & Core Development | | | Gemini AI Debug & Fix • Error Resolution & Logic | | | Cline AI Implementation • Core Modules & Bugs | | | Kimi K2 AI Visual Design • Logo & Brand Assets | | | Grok AI Optimization • Performance Tuning | | | ChatGPT AI Base Engine • Foundation & Boilerplate |


🏷️ Keywords

telegram censor, telegram nudity filter, telegram nsfw filter, telegram adult content filter, telegram channel protection, telegram group moderation, telegram content moderation, telegram policy compliance, telegram ban prevention, telegram porn filter, n8n telegram, n8n content moderation, local ai moderation, nudenet onnx, telegram image blur, telegram auto moderator, telegram channel ban, telegram group ban, telegram policy violation, telegram adult content ban, telegram censorship, telegram moderation bot, telegram privacy, telegram local processing, telegram ai detection, telegram content safety