detail.loadingPreview
Automatically detect and flag toxic language in Telegram messages using Google's Perspective API. Enhance your bot's community safety.
This n8n workflow acts as an intelligent profanity filter for your Telegram bot. It leverages the power of Google's Perspective API to analyze incoming messages for toxic language. When a message is detected as potentially harmful (profanity score above a defined threshold), the workflow triggers a notification or action. The core of this workflow is the 'NoOp' node, which acts as a placeholder for the main logic, and the 'IF' node, which evaluates the profanity score returned by the Google Perspective API.
summaryScore threshold.summaryScore for 'profanity' is greater than your defined threshold (e.g., 0.7).To set up this workflow, you will need: 1. **Telegram Bot Token:** Obtain this from Telegram's BotFather. 2. **Google Cloud Project and API Key:** You'll need to enable the Perspective API within your Google Cloud project and generate an API key. Ensure your project is set up for billing, as the Perspective API may incur costs depending on usage.
The workflow uses an 'IF' node to check the `summaryScore` for profanity from the Google Perspective API against a predefined threshold (e.g., 0.7). If the score is *not* larger than this threshold, the 'IF' condition will be false, and the workflow will not proceed with any subsequent actions related to profanity flagging. This means non-toxic messages are simply passed through without triggering any specific profanity-related actions.
Yes, you can customize the sensitivity by adjusting the `value2` parameter within the 'IF' node's condition. This value represents the threshold. For example, setting `value2` to `0.5` would make the filter more sensitive (flagging messages with lower profanity scores), while setting it to `0.9` would make it less sensitive (only flagging messages with very high profanity scores).
This is a lifesaver for moderating my Discord bot community, which I've adapted this for. The Perspective API is surprisingly good. Keep up the great work!
Was looking for exactly this! My Telegram bot was getting flooded with spam. Setting the threshold low has helped a ton. Thanks!
Integrates smoothly with the Telegram Trigger node. The JSON parsing for the Perspective API output is clean. Minor tweaks to the 'IF' condition made it perfect for my use case. Solid workflow!
{
"id": "a1ec5733-5820-464a-ba54-130f7b5dedce",
"name": "Automated Profanity Filter for Telegram Bots with Google Perspective API",
"nodes": 0,
"category": "Automation",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
ID: a1ec5733-5820...
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Discover more workflows you might like
Creates a JSON configuration file for a standup bot, storing essential details.
Automatically back up n8n workflows to Google Drive on a schedule.
Automatically processes new rows in a Google Sheet, marking them as processed and allowing for subsequent actions.
Processes incoming emails, generates AI-powered responses, and sends them for human approval before final dispatch.
This workflow demonstrates conditional data generation based on an 'id' value using an IF node.
Automate GitHub operations using natural language commands via an MCP Server agent.