Automated Profanity Detection and Response for Telegram
detail.loadingPreview
This workflow automatically detects profanity in Telegram messages using Google's Perspective API. If a message exceeds a predefined toxicity threshold, it triggers an automated response, helping to maintain a positive chat environment.
About This Workflow
This n8n workflow provides a robust solution for moderating Telegram conversations by identifying and reacting to offensive language. It seamlessly integrates with Telegram to monitor incoming messages, leveraging the power of Google's Perspective API to analyze content for profanity. When a message is flagged as potentially toxic (with a profanity score above 0.7), the workflow automatically sends a pre-defined warning message back to the chat, directly replying to the offensive message. For messages that pass the moderation check, the workflow simply proceeds without further action, ensuring smooth communication. This automation is ideal for community managers, group administrators, and anyone looking to foster a more respectful online dialogue.
Key Features
- Real-time Telegram Message Monitoring: Captures various message types including new messages, edited messages, and channel posts.
- Advanced Profanity Detection: Utilizes Google Perspective API to analyze messages for toxicity, specifically focusing on profanity.
- Configurable Toxicity Threshold: Allows you to set a custom score for triggering a profanity warning.
- Automated Response System: Sends an immediate, context-aware reply to flagged messages.
- No-Op for Clean Messages: Efficiently handles non-offensive messages without unnecessary actions.
How To Use
- Set up Telegram Trigger: Configure the
Telegram Triggernode to connect to your Telegram bot and specify which message types to listen for (e.g., 'message', 'edited_message'). - Integrate Google Perspective API: Add the
Google Perspectivenode and authenticate with your Google Cloud credentials. In the parameters, ensure thetextfield dynamically pulls the message content from the Telegram trigger (={{$json["message"]["text"]}}). Select 'profanity' as arequestedAttribute. - Configure the IF Condition: Set up the
IFnode to check thesummaryScoreof the 'PROFANITY' attribute from the Google Perspective output. Use the 'larger' operation with avalue2of0.7(or your desired threshold). - Define Profanity Response: Connect the 'larger' output of the
IFnode to aTelegramnode. Configure this node with your desired warning message (e.g., "I don't tolerate toxic language!") and ensure thechatIdis dynamically set to the original message's chat ID from the Telegram trigger. - Handle Non-Profane Messages: Connect the 'default' (or otherwise) output of the
IFnode to aNoOpnode, or another node for further processing of non-offensive messages.
Apps Used
Workflow JSON
{
"id": "fea5a53f-5412-436f-af66-6dc5c9f66651",
"name": "Automated Profanity Detection and Response for Telegram",
"nodes": 14,
"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: fea5a53f-5412...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
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.