Detect toxic language in Telegram messages

Proactively monitor and filter potentially toxic language in your Telegram group chats with this automated workflow. This n8n automation connects a Telegram Trigger node, which listens for new messages in a designated chat, to the Google Perspective API for content moderation. The Google Perspective node analyzes the incoming message text for various toxicity attributes, and based on the analysis, an IF node then decides whether to send an alert via a Telegram node to a moderator or an administrator, or to simply ignore the message if it's deemed non-toxic. This workflow is invaluable for community managers, online educators, and businesses running public or private Telegram groups who need to maintain a positive and safe online environment. It significantly reduces the manual effort required to review messages, allowing moderators to focus on more complex community engagement while ensuring a respectful communication space and preventing the spread of harmful content.
5 nodesmanual trigger115 views0 copiesSocial Media
Telegram

Workflow JSON

{"nodes": [{"name": "Telegram Trigger", "type": "n8n-nodes-base.telegramTrigger", "position": [600, 300], "webhookId": "2d0805da-143e-40c9-b327-242b1f052c31", "parameters": {"updates": ["message", "edited_message", "channel_post", "edited_channel_post"], "additionalFields": {}}, "credentials": {"telegramApi": "telegram_habot"}, "typeVersion": 1}, {"name": "Google Perspective", "type": "n8n-nodes-base.googlePerspective", "position": [800, 300], "parameters": {"text": "={{$json[\"message\"][\"text\"]}}", "options": {"languages": "en"}, "requestedAttributesUi": {"requestedAttributesValues": [{"attributeName": "identity_attack"}, {"attributeName": "threat"}, {"attributeName": "profanity"}]}}, "credentials": {"googlePerspectiveOAuth2Api": "perspective_api"}, "typeVersion": 1}, {"name": "IF", "type": "n8n-nodes-base.if", "position": [1000, 300], "parameters": {"conditions": {"number": [{"value1": "={{$json[\"attributeScores\"][\"PROFANITY\"][\"summaryScore\"][\"value\"]}}", "value2": 0.7, "operation": "larger"}]}}, "typeVersion": 1}, {"name": "Telegram", "type": "n8n-nodes-base.telegram", "position": [1200, 150], "parameters": {"text": "I don't tolerate toxic language!", "chatId": "={{$node[\"Telegram Trigger\"].json[\"message\"][\"chat\"][\"id\"]}}", "additionalFields": {"reply_to_message_id": "={{$node[\"Telegram Trigger\"].json[\"message\"][\"message_id\"]}}"}}, "credentials": {"telegramApi": "telegram_habot"}, "typeVersion": 1}, {"name": "NoOp", "type": "n8n-nodes-base.noOp", "position": [1200, 400], "parameters": {}, "typeVersion": 1}], "connections": {"IF": {"main": [[{"node": "Telegram", "type": "main", "index": 0}], [{"node": "NoOp", "type": "main", "index": 0}]]}, "Telegram Trigger": {"main": [[{"node": "Google Perspective", "type": "main", "index": 0}]]}, "Google Perspective": {"main": [[{"node": "IF", "type": "main", "index": 0}]]}}}

How to Import This Workflow

  1. 1Copy the workflow JSON above using the Copy Workflow JSON button.
  2. 2Open your n8n instance and go to Workflows.
  3. 3Click Import from JSON and paste the copied workflow.

Don't have an n8n instance? Start your free trial at n8nautomation.cloud

Related Templates

Business WhatsApp AI RAG Chatbot

Automate your business's WhatsApp customer service with an intelligent AI chatbot that leverages your Google Drive documents for accurate, context-aware responses. This powerful workflow connects incoming WhatsApp messages, triggered by a webhook, to an OpenAI-powered AI Agent, which then queries a Qdrant Vector Store populated with information from your Google Drive files. When a customer sends a message, the workflow first verifies the webhook, then routes the message to the AI Agent. The AI Agent uses an OpenAI Chat Model and a Window Buffer Memory to maintain conversation context, retrieving relevant data from your Google Drive documents via the Qdrant Vector Store, which is kept up-to-date by the Refresh collection and Create collection HTTP requests. Google Drive's Get folder and Download Files nodes extract your business's knowledge base, which is then processed by the Embeddings OpenAI, Default Data Loader, and Token Splitter nodes before being stored in Qdrant. This setup allows businesses to provide instant, personalized support 24/7, reducing response times, freeing up staff from repetitive inquiries, and ensuring consistent, accurate information delivery directly through WhatsApp. It's ideal for sales teams answering product questions, support departments resolving common issues, or marketing teams providing information about services, significantly enhancing customer satisfaction and operational efficiency.

24 nodes

Discord AI bot

Automate the intelligent routing of incoming user requests from a webhook to the appropriate Discord department with this powerful workflow. This n8n workflow leverages OpenAI's advanced natural language processing to analyze user input, then directs the request to either the User Success Dept, IT Dept, or Helpdesk Discord channel based on the identified category. Imagine a customer submitting a query through a web form; this workflow instantly understands their need and posts it in the relevant team's Discord channel, eliminating manual triage and ensuring faster response times. This solution is ideal for businesses and support teams looking to streamline their customer service operations, reduce response delays, and improve internal communication by automatically categorizing and distributing inquiries, saving significant time and effort in managing support tickets.

9 nodes

Telegram AI-bot

Build an intelligent Telegram AI-bot that responds to user messages, generates images, and provides dynamic greetings. This workflow connects Telegram as the primary communication channel with OpenAI for advanced AI capabilities, including text generation for chat responses and image creation. Users can interact with the bot to ask questions, receive personalized greetings, or request images, making it ideal for customer support, community engagement, or creative content generation. By automating AI-powered interactions directly within Telegram, this solution significantly reduces manual effort in responding to common queries, generating visual content, and maintaining an active, engaging presence, ultimately saving time and resources for businesses and individuals alike.

16 nodes

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.