Back to Nodes

Operation

Last updated May 3, 2026

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

91 Weekly Downloads
250 Monthly Downloads

Included Nodes

Operation

Description

!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

my.telegram.org

  • Create a new application
  • Note your API ID and API Hash
  • 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, videos, or documents | Extract media 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 |
    | 📝 Replace Text | Update text or captions without new media | Fix copy while keeping media |
    | ✉️ Send Message | Send formatted messages with optional media | Alerts, reports, and safe reposts |

    📋 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 |
    | ————————– | ———————— | ———– |
    | FEMALEGENITALIAEXPOSED | Exposed female genitalia | 🔴 Critical |
    | MALEGENITALIAEXPOSED | Exposed male genitalia | 🔴 Critical |
    | FEMALEBREASTEXPOSED | Exposed female breasts | 🔴 Critical |
    | MALEBREASTEXPOSED | 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 compile the node and copy the ONNX model |
    | “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 N8NLOGLEVEL=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

  • Operations Guide – Detailed operation documentation
  • Authorization Guide – Setup Telegram credentials
  • Troubleshooting Guide – Common issues and fixes
  • Changelog – Release notes and upgrade-impact summary
  • Contributing Guide – How to contribute
  • 🤝 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

    Start local n8n node development

    npm run dev

    Lint and package verification

    npm run lint npm test

    Useful project scripts:

  • npm run build – runs n8n-node build and copies the NudeNet model into dist/models
  • npm run build:watch – TypeScript watch mode for local iteration
  • npm run lint:fix – fixes lint issues with the n8n node CLI
  • npm run release – release flow powered by n8n-node release
  • 📄 License

    MIT License – see license file for details.

    🔗 Resources

  • Telegram API Documentation
  • TeleProto Documentation
  • n8n Custom Nodes Guide
  • NudeNet GitHub
  • ONNX Runtime
  • 💬 Support

  • GitHub Issues: Report bugs or request features
  • Email: krushnakantsadiya@gmail.com
  • NPM Package: n8n-nodes-telegram-censor
  • ⚠️ 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
  • Publishing Status

    ![Build Status](https://github.com/sadiakant/n8n-nodes-telegram-censor/actions/workflows/build.yml)
    ![Publish Status](https://github.com/sadiakant/n8n-nodes-telegram-censor/actions/workflows/publish.yml)
    ![Socket Badge](https://badge.socket.dev/npm/package/n8n-nodes-telegram-censor)
    ![GitHub Issues](https://github.com/sadiakant/n8n-nodes-telegram-censor/issues)
    ![GitHub Pull Requests](https://github.com/sadiakant/n8n-nodes-telegram-censor/pulls)

    NPM Status

    ![npm version](https://www.npmjs.com/package/n8n-nodes-telegram-censor)
    ![npm downloads/week](https://www.npmjs.com/package/n8n-nodes-telegram-censor)
    ![npm downloads/month](https://www.npmjs.com/package/n8n-nodes-telegram-censor)
    ![npm downloads/year](https://www.npmjs.com/package/n8n-nodes-telegram-censor)
    ![node version](https://www.npmjs.com/package/n8n-nodes-telegram-censor)
    ![npm license](LICENSE)
    ![GitHub license](LICENSE)
    ![npm total downloads](https://www.npmjs.com/package/n8n-nodes-telegram-censor)
    ![npm unpacked size](https://www.npmjs.com/package/n8n-nodes-telegram-censor)
    ![npm types](https://www.npmjs.com/package/n8n-nodes-telegram-censor)
    ![npm collaborators](https://www.npmjs.com/package/n8n-nodes-telegram-censor)

    GitHub Status

    ![github stars](https://github.com/sadiakant/n8n-nodes-telegram-censor/stargazers)
    ![github forks](https://github.com/sadiakant/n8n-nodes-telegram-censor/network/members)
    ![last commit](https://github.com/sadiakant/n8n-nodes-telegram-censor/commits/main)
    ![GitHub contributors](https://github.com/sadiakant/n8n-nodes-telegram-censor/graphs/contributors)
    ![GitHub watchers](https://github.com/sadiakant/n8n-nodes-telegram-censor/watchers)
    ![GitHub issues closed](https://github.com/sadiakant/n8n-nodes-telegram-censor/issues)
    ![GitHub PRs closed](https://github.com/sadiakant/n8n-nodes-telegram-censor/pulls)
    ![Commit activity](https://github.com/sadiakant/n8n-nodes-telegram-censor/commits/main)
    ![Repo size](https://github.com/sadiakant/n8n-nodes-telegram-censor)
    ![Code size](https://github.com/sadiakant/n8n-nodes-telegram-censor)
    ![Top language](https://github.com/sadiakant/n8n-nodes-telegram-censor)

    Dependency Status

    ![sharp dependency](https://www.npmjs.com/package/sharp)
    ![onnxruntime-web dependency](https://www.npmjs.com/package/onnxruntime-web)
    ![n8n-workflow peer dependency](https://www.npmjs.com/package/n8n-workflow)

    ![Teleproto API](https://core.telegram.org/api)
    ![TypeScript](https://www.typescriptlang.org/)
    ![n8n](https://n8n.io/)
    ![Node >= 18.17](https://nodejs.org/)
    ![AI: Local Only](https://onnxruntime.ai/)

    🏷️ 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