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 trigger85 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

Telegram AI multi-format chatbot

Automate a multi-format AI chatbot on Telegram, allowing users to interact via text or voice. This workflow connects Telegram for user input and replies with OpenAI for AI processing and voice-to-text conversion. It's ideal for customer support, content generation, or interactive learning platforms. This saves significant time and effort in managing diverse user interactions.

15 nodes

Post New YouTube Videos to X

Automatically share your latest YouTube video content on X (formerly Twitter) with this powerful n8n workflow. This automation regularly checks your YouTube channel for new uploads, then leverages OpenAI's ChatGPT to craft engaging X posts, and finally publishes them directly to your X account. Content creators, businesses, and marketers can use this to maintain a consistent social media presence, ensuring their audience on X is immediately notified of new video releases without manual intervention. This workflow eliminates the need to constantly monitor your YouTube channel and manually compose social media updates, saving significant time and effort while boosting content visibility and audience engagement.

6 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

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.