Documentation
Learning Centre

Master Telegram Bot App with comprehensive guides, tutorials, and documentation

Quick Links

Prohibited Content and Bot Protection

Introduction

The Prohibited Content Detection system provides granular control over what types of content members can share in your Telegram group, offering comprehensive filtering beyond simple content analysis. While features like NSFW detection and sentiment analysis evaluate what's in the content, Prohibited Content Detection determines whether certain types of content should be allowed at all, regardless of their specific payload.

This feature set encompasses multiple independent controls for different content categories: media types (videos, GIFs, audio, files, text), forwarded messages, invite links to other groups, and unauthorized bots joining your community. Each control can be enabled or disabled independently, allowing you to create precisely calibrated content policies that match your community's needs and culture.

The system operates at the message processing level, examining incoming content before other analysis systems engage. This means prohibited content types are blocked immediately without consuming quota from premium features like image scanning or sentiment analysis. For communities with specific content restrictions—such as text-only discussion groups, no-forwarding policies to prevent spam propagation, or strict bot exclusion rules—these controls provide essential enforcement capabilities.

How It Works

Media Type Filtering

The Prohibited Content Detection system examines each incoming message to identify its media type based on Telegram's message structure. When a user posts content, Telegram's API indicates whether the message contains video, animations (GIFs), audio/voice, document attachments, or plain text. The bot checks these indicators against your configured prohibitions and takes enforcement action if a prohibited type is detected.

This media type detection operates independently of content analysis. Even if a video contains completely appropriate content, it will be removed if "Block Videos" is enabled. This allows communities to enforce structural rules about communication formats rather than just content appropriateness.

Each media type has its own toggle:

  • Block Videos: Removes all video file attachments and video messages
  • Block GIFs: Removes animated GIF files and sticker messages with animation
  • Block Audio: Removes both audio file attachments and voice messages recorded through Telegram
  • Block Files: Removes document attachments of any type (PDFs, executables, archives, etc.)
  • Block Text Messages: Removes messages containing text (creates media-only mode)

The enforcement is immediate—when a prohibited media type is detected, the message is deleted from the chat and the user receives a 1-minute restriction preventing them from posting additional messages during that period.

Forwarded Message Blocking

Telegram messages can be "forwarded" from other chats, channels, or groups, carrying attribution showing where they originated. Forwarded messages are a common spam vector, as malicious actors copy promotional content from spam channels and forward it to multiple groups simultaneously.

When "Block Forwards" is enabled, the bot examines each message's forward metadata. If the message has been forwarded from any source (regardless of the actual content), it is immediately removed and the sender receives a 1-minute restriction.

This setting operates at the highest priority—even if other content would be acceptable, being forwarded disqualifies it. This strict enforcement helps prevent spam propagation and ensures all shared content is original to your group rather than redistributed from external sources.

The block applies to forwards from channels, other groups, and individual private chats. It does not affect messages that quote or reply to previous messages within the same group—only messages explicitly forwarded from external sources.

Invite Link Blocking

Telegram invite links allow users to promote other groups or channels by posting links that automatically join people who click them. These links follow specific patterns:

  • t.me/joinchat/[code] - Private group invite links
  • t.me/+[code] - Modern private group invite format
  • @grouphandle - Public group/channel mentions
  • WhatsApp links: chat.whatsapp.com/[code] and wa.me/[phone]

When "Block Invite Links" is enabled, the bot scans message text for these patterns using sophisticated detection that catches even obfuscated or shortened versions. It also checks common URL shorteners (bit.ly, tinyurl.com, goo.gl, etc.) to prevent evasion through link masking.

The system includes intelligent whitelisting—your own group's invite link is automatically exempted from blocking, allowing administrators to share the group's official invite without triggering violations.

Detection is case-insensitive and handles spacing variations, making it difficult for spammers to bypass through character manipulation. When an invite link is detected, the message is deleted immediately and the user receives a 5-minute restriction (longer than media violations due to the higher spam likelihood).

Bot Exclusion Protection

Telegram allows bots (automated accounts identified by their "bot" status in the Telegram API) to be added to groups just like regular users. However, unauthorized bots can present spam, security, or privacy risks.

When "Ban Other Bots" is enabled, the system monitors for new members joining the group. If a joining member is identified as a bot (based on Telegram's API is_bot flag) and that bot is not already whitelisted as an authorized moderation bot, it is immediately banned from the group.

This protection prevents malicious actors from adding spam bots, scraper bots, or other unwanted automated accounts to your community. It operates automatically whenever a bot joins, requiring no manual administrator intervention.

Your authorized moderation bot (the Telegram Bot App bot itself) is always whitelisted and will never be affected by this setting, regardless of configuration.

Configuration

Accessing Prohibited Content Settings

To configure content prohibitions and restrictions:

  1. Navigate to your group's management page in the panel
  2. Select the "Settings" tab
  3. Click on the "Basic Protection" sub-tab
  4. Scroll to the "Content Restrictions" section
  5. Toggle each prohibition according to your needs

All settings in this section are Free tier features available to all groups regardless of subscription level.

Media Type Controls

In the "Content Restrictions" section, you'll find toggles for each media type:

  • Block Videos - Prevents members from posting video files or video messages
  • Block GIFs - Prevents members from posting animated GIFs or animated stickers
  • Block Audio - Prevents members from posting audio files or voice messages
  • Block Files - Prevents members from posting document attachments
  • Block Text Messages - Prevents members from posting text (allows only media)

Each toggle works independently. You can enable any combination based on your community's communication preferences.

Important: Enabling "Block Text Messages" creates a media-only mode where members can only share images, videos, and other media without accompanying text. This is useful for photo-sharing communities or meme groups but will make normal text conversation impossible.

Forwarding and Links

Also in the "Content Restrictions" section:

  • Block Forwards - Prevents members from forwarding messages from other chats, channels, or groups
  • Block Invite Links - Prevents members from sharing Telegram or WhatsApp group/channel invite links

These settings help control content circulation and prevent spam promotion.

Bot Protection

In the "User Management" section at the top of "Basic Protection":

  • Ban Other Bots - Automatically bans any unauthorized bots that join the group

This setting protects against bot spam and unauthorized automation.

Settings Combinations

You can combine these settings to create specific content policies:

Text-Only Discussion Group:

  • Block Videos: ✓
  • Block GIFs: ✓
  • Block Audio: ✓
  • Block Files: ✓
  • Block Text Messages: ✗

Media Gallery (No Text):

  • Block Videos: ✗
  • Block GIFs: ✗
  • Block Audio: ✗
  • Block Files: ✗
  • Block Text Messages: ✓

Strict Anti-Spam Configuration:

  • Block Forwards: ✓
  • Block Invite Links: ✓
  • Ban Other Bots: ✓

Professional Community (Documents and Text Only):

  • Block Videos: ✓
  • Block GIFs: ✓
  • Block Audio: ✓
  • Block Files: ✗
  • Block Forwards: ✓
  • Block Invite Links: ✓

Mix and match based on your community's unique requirements.

Real-World Scenarios

Scenario 1: Professional Discussion Group

A professional networking community wants to maintain serious, high-quality discussions without memes, voice messages, or video content that might distract from text-based professional exchanges.

Configuration:

  • Block Videos: ✓
  • Block GIFs: ✓
  • Block Audio: ✓
  • Block Files: ✗ (allow document sharing for resumes, presentations)
  • Block Text Messages: ✗

Result: Members can share text discussions and professional documents but cannot post distracting media. The community maintains its professional atmosphere without manual moderation of every meme or funny video.

Scenario 2: Photo Sharing Community

A photography enthusiast group wants members to share only images without text commentary flooding the chat.

Configuration:

  • Block Videos: ✗ (allow video clips of photography techniques)
  • Block GIFs: ✓ (prevent meme spam)
  • Block Audio: ✓
  • Block Files: ✓
  • Block Text Messages: ✓ (media-only mode)

Result: The chat becomes a visual gallery where members post photos and videos without text. This creates a clean, focused browsing experience for visual content. Administrators can still post text when needed (admin messages bypass restrictions).

Scenario 3: Anti-Spam Educational Community

A language learning community experiences constant spam from competing course providers forwarding promotional messages from their spam channels and posting invite links to their own groups.

Configuration:

  • Block Forwards: ✓ (stop spam propagation)
  • Block Invite Links: ✓ (prevent group promotion)
  • Ban Other Bots: ✓ (prevent scraper bots)

Result: Spam drops dramatically because the primary spam vectors (forwards and invite links) are immediately blocked. The community's legitimate discussions continue unaffected because members weren't forwarding content or sharing external group invitations anyway.

Scenario 4: Voice-Free Reading Community

A book club community finds that voice messages create accessibility problems (members can't easily review them later, hearing-impaired members are excluded, and they're difficult to search or quote).

Configuration:

  • Block Videos: ✗
  • Block GIFs: ✗
  • Block Audio: ✓ (block voice messages specifically)
  • Block Files: ✗
  • Block Text Messages: ✗

Result: Members communicate through text and can share images or book covers, but voice messages are prohibited. This creates an inclusive, searchable discussion environment where all content is accessible to all members regardless of hearing ability or audio playback capability.

Scenario 5: Curated News Community

A news discussion community wants to prevent members from sharing unverified content forwarded from random channels while still allowing original commentary and discussion.

Configuration:

  • Block Forwards: ✓ (require original sharing, not forwards)
  • Block Invite Links: ✓ (prevent channel promotion)
  • All media types: ✗ (allow diverse content types)

Result: Members must manually share news links or screenshots rather than forwarding from channels. This small friction encourages critical evaluation of sources and reduces the spread of misinformation that propagates through rapid forwarding chains.

Best Practices

Start with Minimal Restrictions

When first configuring Prohibited Content Detection, start with no restrictions enabled and observe your community's natural communication patterns for a week. Identify which media types or content sources cause actual problems rather than preemptively restricting everything.

This observation period prevents you from inadvertently disrupting valuable communication modes that your community relies on. For example, you might discover your community regularly shares helpful video tutorials (don't block videos) but never posts GIFs except as spam (safe to block GIFs).

Communicate Rules Clearly

When you enable content prohibitions, update your welcome message and group description to explain the restrictions. Members need to understand why certain content types are blocked to avoid frustration and confusion.

Example welcome message additions:

  • "This is a text-only discussion group. Please do not post videos, GIFs, or voice messages."
  • "Do not forward messages from other channels or share invite links to other groups."
  • "This group does not allow file attachments. Please share documents through external links."

Clear communication sets appropriate expectations and reduces the number of users who accidentally violate restrictions.

Combine with CAPTCHA

Blocked content restrictions work well alongside CAPTCHA verification. New members must first pass CAPTCHA (proving they're human), then their content is filtered for prohibited types. This two-layer approach stops both automated bots and human spammers.

Review Violation Statistics

Regularly check your group's violation statistics to see which restrictions are catching the most content. If "Block Videos" generates many violations, videos might be a common spam vector in your community. If no violations occur for a particular restriction, you might not need it enabled.

This data-driven approach helps you refine your content policy based on actual community behavior rather than assumptions.

Adjust Based on Community Maturity

New communities might need stricter restrictions while they establish culture and norms. Mature communities with well-behaved members might relax restrictions over time. Consider your community's lifecycle:

New Community (0-3 months):

  • Enable strict restrictions to prevent early spam from derailing growth
  • Block forwards and invite links aggressively
  • Ban other bots automatically

Growing Community (3-12 months):

  • Review which restrictions are necessary based on violation data
  • Relax restrictions that generate few violations
  • Keep restrictions that actively prevent spam

Mature Community (12+ months):

  • Minimal restrictions if community culture is established
  • Targeted restrictions only for proven problem areas
  • Trust community norms to self-regulate many issues

Exempt Administrators Carefully

The bot automatically exempts group administrators from restrictions—admins can post any content type regardless of settings. Use this capability responsibly:

  • Admins can post videos in a no-video group to share important announcements
  • Admins can share the group invite link even with invite blocking enabled
  • Admins can post forwards of official information when needed

However, avoid abusing admin exemptions. If you tell members "no videos allowed" but administrators regularly post videos, it undermines the rule's credibility and creates resentment.

Integration with Other Features

Complementary to Content Analysis

Prohibited Content Detection operates at a different level than content analysis features:

  • NSFW Detection: Analyzes what's in images
  • Prohibited Content: Blocks images entirely if media restrictions are enabled

These can work together—for example, allow images (don't block media type) but scan them for NSFW content. Or block videos entirely while still scanning allowed images. The combination gives you both structural control (what types allowed) and content control (what content within allowed types is acceptable).

Priority Over Other Systems

Prohibited content restrictions execute before content analysis systems. If videos are blocked, the bot deletes video messages without sending them to NSFW scanning or sentiment analysis. This saves quota consumption on premium features—you won't waste image scans analyzing content that's prohibited by type anyway.

This priority ordering optimizes resource usage and ensures prohibited content is removed as quickly as possible without unnecessary processing.

Enhancement to Spam Prevention

Blocking forwards and invite links significantly reduces spam effectiveness. Many spam campaigns rely on forwarding the same message to hundreds of groups or promoting external channels through invite links. By blocking these vectors, you eliminate the most efficient spam distribution methods.

Combined with AI Spam Intelligence and Spam Pattern Detection, prohibited content restrictions create a multi-layered spam defense that addresses both content-based spam (detected by spam analyzers) and structural spam (prevented by prohibited content rules).

Support for Community Culture

Beyond technical spam prevention, these restrictions help enforce community culture and communication norms. A professional community that establishes "text-only" culture through media restrictions develops different interaction patterns than a meme-sharing community.

By technically enforcing these cultural norms through automated restrictions, you reduce the moderation burden on human administrators who would otherwise need to manually remind members about informal rules.

Advanced Usage

Media-Only Mode for Visual Communities

Enabling "Block Text Messages" creates a unique media-only mode where the group functions as a visual gallery. This mode works well for:

  • Photography sharing communities
  • Art showcase groups
  • Meme collections
  • Screenshot sharing
  • Video content curation

In this mode, consider also enabling "Block Audio" and "Block Files" to create a purely visual experience with only images, GIFs, and videos.

Temporary Restrictions During Events

You can temporarily enable stricter restrictions during specific events or time periods. For example:

  • Block all media during important text announcements to ensure members see the message
  • Block forwards during sensitive discussions to prevent leaks
  • Block invite links during spam waves
  • Enable text-only mode during structured Q&A sessions to keep focus on questions

After the event, revert to normal settings. This dynamic adjustment provides flexibility for special circumstances.

Selective Bot Whitelisting

While "Ban Other Bots" blocks all unauthorized bots, you can whitelist specific bots by adding them before enabling the setting. Bots already present in the group when you enable the restriction won't be banned—only new bot additions are blocked.

This allows you to use authorized utility bots (music bots, game bots, poll bots) while preventing unauthorized bot spam.

Forwarding as Verification Signal

Blocking forwards can serve as an anti-spam verification signal even in communities where forwarding isn't inherently problematic. Legitimate users will naturally share content by copying and reposting, while lazy spammers rely on bulk forwarding from spam channels.

By blocking forwards, you force all content sharing to be intentional and direct, adding a small friction barrier that deters low-effort spam without significantly impacting legitimate users.

Invite Link Detection Scope

The invite link blocking system catches:

  • Direct Telegram invite links (t.me/joinchat/..., t.me/+...)
  • Public group/channel mentions (@groupname)
  • WhatsApp group invites (chat.whatsapp.com/...)
  • URL shortened versions of above (bit.ly/... pointing to invite links)

This comprehensive detection prevents evasion attempts. Spammers cannot bypass by using URL shorteners or alternative formatting.

Your own group's invite link is automatically whitelisted, so administrators can share it without triggering violations.

Technical Implementation

The Prohibited Content Detection system operates as part of the telegram_prohibited microservice, which receives message events from the message processing pipeline. The service examines message metadata (media type indicators, forward information, text content for link patterns) before the message reaches content analysis systems.

Each prohibition check follows a priority order:

  1. Forward check (highest priority—checked first)
  2. Media type check (video, GIF, audio, file, text)
  3. Invite link check (text pattern analysis)
  4. Bot detection (on member join events, not message events)

When a prohibition is violated, the service sends a deletion command to the Telegram API to remove the message, followed by a restriction command to temporarily mute the user. The violation is logged with details including the prohibition type, timestamp, and user information for administrator review in group statistics.

The invite link detection employs regular expressions optimized for performance and accuracy, matching known invite link patterns while avoiding false positives on legitimate URLs. The pattern library is regularly updated to catch new link formats and shortener domains as they emerge.

Bot detection relies on Telegram's official is_bot flag in user metadata, ensuring accurate identification. The whitelist check compares the bot's user ID against a list of authorized bots maintained per group, allowing selective bot access even with global bot blocking enabled.

All enforcement actions are logged to the group's moderation history, visible in the panel's statistics section, ensuring transparency and allowing administrators to audit the system's behavior over time.

Privacy & Data Handling

The Prohibited Content Detection system processes:

  • Message metadata: Media type indicators, forward status, timestamps
  • Text content: Only scanned for invite link patterns, not stored
  • Bot status: User is_bot flag from Telegram API
  • User identifiers: For logging violations

The system does not store full message content or detailed text analysis. Invite link detection operates on-the-fly without retaining the text after pattern matching completes.

Violation logs include the prohibition type (e.g., "video_blocked") and timestamp but do not store the actual prohibited content itself, respecting privacy while maintaining enforcement transparency.

Bot detection operates solely on Telegram's official metadata and does not involve external profiling or privacy-invasive analysis.

Troubleshooting

"Administrator messages are being blocked"

Possible cause:

  • Settings apply to all members initially, but admins should be exempted

Solution: Administrators (users with admin rights in Telegram group) should automatically bypass content restrictions. If an admin's content is being blocked, verify they have proper administrator status in the Telegram group settings (not just in the bot's panel).

"Legitimate content contains invite links and gets blocked"

Possible cause:

  • Messages legitimately reference other Telegram groups or contain WhatsApp links
  • Your community regularly shares cross-references to related groups

Solution: If legitimate discussion requires sharing group references, you may need to disable "Block Invite Links" and rely on other spam prevention methods (AI Spam Intelligence, Spam Pattern Detection) to catch promotional spam without blocking legitimate group mentions.

"Can't post any content after enabling media-only mode"

Possible cause:

  • "Block Text Messages" is enabled, preventing all text

Solution: Media-only mode ("Block Text Messages" enabled) allows only media attachments without text. To post anything, send images, videos, GIFs, or other media. If you meant to create a text-only group, disable "Block Text Messages" and instead enable blocks for videos, GIFs, audio, and files.

"Block forwards not catching all forwarded content"

Possible cause:

  • Some forwards might be detected as media types first if media blocking is also enabled
  • Telegram sometimes doesn't mark all redistributed content as "forwarded"

Solution: The forward check has highest priority and should catch all messages Telegram marks as forwarded. If content slips through, it might not technically be a forward (could be copy-pasted or screenshot instead). Review the message in question to verify whether it's actually marked as forwarded in Telegram.

"Users complaining about getting muted for normal messages"

Possible cause:

  • Settings might be misconfigured (e.g., text blocking enabled unintentionally)
  • Legitimate message happened to contain pattern matching invite link detection

Solution: Review your Prohibited Content settings to ensure only intended restrictions are enabled. Check violation logs to see exactly what triggered the restriction. If false positives occur with invite link detection (legitimate URLs containing patterns like "t.me"), you may need to disable that specific restriction.

"Bot exclusion banned our authorized utility bot"

Possible cause:

  • The utility bot was added after "Ban Other Bots" was enabled
  • The bot is not in the whitelist

Solution: Disable "Ban Other Bots," add the authorized utility bot to the group, verify it's working, then re-enable "Ban Other Bots." Bots present before enabling the restriction are automatically whitelisted.

Conclusion

Prohibited Content Detection provides essential structural controls over communication in your Telegram group, allowing you to enforce content type policies, prevent spam propagation through forwards and invite links, and protect against unauthorized bot additions. These controls operate independently of content analysis, giving you complementary layers of community management that address both what types of content are allowed and what specific content within those types is acceptable.

The granular toggle-based configuration ensures you can precisely calibrate restrictions to match your community's unique needs—whether that's a text-only professional environment, a media-focused visual gallery, or a mixed-use community with targeted prohibitions against specific spam vectors. Each restriction can be enabled or disabled independently, providing maximum flexibility.

Combined with other moderation features like NSFW detection, sentiment analysis, spam pattern detection, and AI spam intelligence, Prohibited Content Detection creates a comprehensive moderation ecosystem that addresses spam, inappropriate content, and communication structure from multiple angles. The result is a well-moderated community that maintains the culture and communication style you want to foster.

Enable the prohibitions that make sense for your community today to establish clear, automatically-enforced boundaries around acceptable content types, prevent spam propagation, and maintain the communication standards that make your community valuable to its members.

Written by the Telegram Bot App team · Last updated June 2026

Related Articles

Block Telegram Porn Bots: NSFW Content Filter Guide

Stop porn bots and adult content in your Telegram group. Complete guide to NSFW filtering, adult content detection, and protecting your community from inappropriate images.

Sentiment Analysis and Toxicity Detection

Automatic detection of toxic behavior, profanity, insults, and threats

AI Spam Intelligence and User Risk Assessment

Automated behavioral analysis and intelligent spam prevention with risk scoring

Telegram Bot App

AI-powered group moderation

© 2026 Telegram Bot App. All rights reserved.