Build Your Own Toxic Language Detector for Telegram
detail.loadingPreview
Automatically detect and flag toxic language in your Telegram messages using AI. This workflow leverages n8n and Google's Perspective API to moderate conversations and maintain a positive environment.
About This Workflow
This n8n workflow empowers you to create a real-time toxic language detector for your Telegram channels or groups. It's designed to automatically analyze incoming messages, identify potentially harmful content such as profanity, and take immediate action. By integrating with Google's Perspective API, it provides a sophisticated understanding of message toxicity across various attributes. The workflow then uses a conditional step to trigger alerts or specific actions based on the analysis, ensuring your Telegram community remains a safe and respectful space. This solution is ideal for community managers, bot developers, and anyone looking to proactively moderate online interactions.
Key Features
- Real-time Message Analysis: Instantly scans incoming Telegram messages for toxic language.
- AI-Powered Toxicity Detection: Utilizes Google's Perspective API for advanced sentiment and toxicity scoring.
- Configurable Toxicity Thresholds: Easily adjust the sensitivity to profanity and other negative attributes.
- Automated Response Actions: Trigger custom responses when toxic language is detected.
- Flexible Telegram Integration: Works with various Telegram message types (messages, channel posts, etc.).
How To Use
- Set up Telegram Credentials: In n8n, add your Telegram Bot Token under 'Credentials' for the 'Telegram Trigger' and 'Telegram' nodes.
- Configure Telegram Trigger: Select the desired message types (e.g., 'message', 'channel_post') to monitor.
- Set up Google Perspective API Credentials: Obtain API credentials for Google Cloud and add them to n8n for the 'Google Perspective' node.
- Configure Google Perspective Node: In the 'Google Perspective' node, map the Telegram message text to the 'text' parameter. Specify the attributes you want to analyze (e.g., 'identity_attack', 'threat', 'profanity').
- Define IF Condition: In the 'IF' node, set a condition based on the toxicity score (e.g.,
value2: 0.7for profanity). Adjust the 'operation' as needed (e.g., 'larger'). - Configure Action Node: For the 'true' branch of the IF condition, configure the 'Telegram' node to send a warning message or take another action. Use the expression
={{$node["Telegram Trigger"].json["message"]["chat"]["id"]}}to reply in the correct chat and={{$node["Telegram Trigger"].json["message"]["message_id"]}}to reply to the specific message. - Configure NoOp Node: For the 'false' branch of the IF condition, connect to the 'NoOp' node, indicating no action is needed for non-toxic messages.
Apps Used
Workflow JSON
{
"id": "5e0e97ce-2276-4045-97e7-2ee12fc8b4e4",
"name": "Build Your Own Toxic Language Detector for Telegram",
"nodes": 18,
"category": "DevOps",
"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: 5e0e97ce-2276...
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
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Automate Qualys Report Generation and Retrieval
Streamline your Qualys security reporting by automating the generation and retrieval of reports. This workflow ensures timely access to crucial security data without manual intervention.
Visualize Your n8n Workflows: Interactive Dashboard with Mermaid.js
Gain unparalleled visibility into your n8n automation landscape. This workflow transforms your n8n instance into a dynamic, interactive dashboard, leveraging Mermaid.js to visualize all your workflows in one accessible place.