Telegram Toxicity Filter Bot
detail.loadingPreview
Automate Telegram group moderation by detecting and flagging toxic language. This workflow uses Google's Perspective API to analyze messages and respond to profanity.
About This Workflow
Enhance your Telegram community's experience with an intelligent moderation bot. This n8n workflow seamlessly integrates with Telegram to monitor incoming messages across various update types, including regular messages, edited messages, and channel posts. Upon receiving a message, it leverages the power of Google's Perspective API to analyze its content for toxicity, specifically focusing on profanity. If the profanity score exceeds a predefined threshold, the bot will automatically reply to the message, alerting the user that toxic language is not tolerated. For messages that do not violate the toxicity threshold, the workflow proceeds to a no-operation step, ensuring efficient processing. This provides a robust solution for maintaining a positive and respectful environment within your Telegram groups.
Key Features
- Real-time message monitoring for Telegram chats and channels.
- Utilizes Google Perspective API for advanced toxicity analysis (profanity detection).
- Configurable profanity detection threshold for customized moderation.
- Automated replies to messages containing unacceptable language.
- Seamless integration with n8n for easy automation.
How To Use
- Set up Telegram Trigger: Configure the
Telegram Triggernode with your Telegram bot token and specify which message types to listen for (e.g.,message,edited_message). - Integrate Google Perspective API: Authorize the
Google Perspectivenode with your Google Cloud credentials and set thetextfield to dynamically receive the message content from the Telegram trigger (e.g.,={{$json["message"]["text"]}}). Request theprofanityattribute. - Define Toxicity Threshold: In the
IFnode, set the condition to check the profanity score from the Google Perspective API. For example,={{$json["attributeScores"]["PROFANITY"]["summaryScore"]["value"]}} larger 0.7to flag messages with a profanity score above 0.7. - Configure Toxic Response: In the
Telegramnode connected to the 'true' branch of the IF node, customize the response message and ensure thechatIdandreply_to_message_idare correctly mapped from the Telegram Trigger node. - Handle Non-Toxic Messages: Connect the 'false' branch of the IF node to a
NoOpnode or any subsequent automation steps for messages that don't trigger the toxicity filter.
Apps Used
Workflow JSON
{
"id": "785c43a9-eea9-4715-b6c5-b3d0f158db8b",
"name": "Telegram Toxicity Filter Bot",
"nodes": 8,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 785c43a9-eea9...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Related Workflows
Discover more workflows you might like
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.