Skip to main content

⚙️ Filters

The Filters feature in the Fren One bot helps administrators automatically remove messages that meet certain criteria. Filters are designed to minimize spam and scams, ensuring your community stays safe and clean.

Overview

Filters can be applied to all users or targeted specifically to new users, with the definition of a "new user" being fully customizable. This powerful feature allows you to protect your community from unwanted content while maintaining flexibility for trusted members.

Configuration

To access Filters:

  1. Use the /settings command in your chat
  2. Navigate to 🛡️ Moderation⚙️ Filters
  3. Select Create Filter to begin setup

Setting Up a Filter

Select Create Filter from the Filters menu. You'll be presented with the following default filtering options:

Filter Conditions

  • Contains link: Removes messages that contain any hyperlink
  • Contains mention: Removes messages that mention other users (e.g., using @username)
  • Is forwarded: Removes forwarded messages
  • Is Story: Removes Telegram Stories posted in the chat
  • External Quote: Removes messages that include externally quoted content
  • Contains Buttons: Removes messages that include buttons
  • Is new user: Restrict the filter to apply only to users defined as "new" (customizable in New User Definition in the Filters menu)
Combining Conditions

You can combine multiple conditions to create more sophisticated filters. For example, remove messages that contain links from new users only.

Filter Actions

Proceed to Actions. Once you select the conditions for the filter, choose what action the bot should take when the filter is triggered:

  • Delete: Automatically deletes the message
  • Ban and delete the message: Deletes the message and bans the user from the group

After setting up the filter, a confirmation message will appear.

Managing Filters

Administrators can view, edit, or delete existing filters under the Filters menu. Each filter displays its:

  • Conditions: The criteria the filter checks for (e.g., Contains Link, Is Forwarded)
  • Action: What happens when the filter is triggered (e.g., Delete, Delete and Ban)

Defining a New User

You can create a filter that will only apply to new users. The definition of a "new user" is customizable under New User Definition with the following options:

New User Criteria

  • Never sent a message: Users who have not yet sent a message in the group
  • Joined within X days: Specify the number of days after which a user is no longer considered new
  • Combination of both: Combination of users that have never sent a message and those that joined within a specified number of days.

Mode Options

Switch between:

  • Never sent a message AND joined within X days: User must meet both conditions
  • Never sent a message OR joined within X days: User meets either condition
Example Configuration

Set "new user" as: Joined within 7 days OR Never sent a message. This protects against both fresh accounts and lurkers.

Domain and User Exceptions

Filters can be fine-tuned by creating exceptions for trusted domains or users. These options are managed under Chat Settings available in the main menu:

📋 Exception List

Allows you to exclude certain links or mentions from being moderated.

💡 Add trusted domains like:

  • x.com
  • twitter.com
  • Your project's website
  • Partner websites
  • Official announcement channels
Domain Format

Add domains without the protocol (e.g., use example.com not https://example.com).

Manage User Exceptions

Whitelist mentions of specific users to exempt them from all filters. This is useful when community members tag trusted members of the community, the team, or support: e.g. admins or moderators.

User Whitelist vs User Exceptions

User Exceptions only apply to mention filter. For broader moderation exemptions, use the User Whitelist feature.

Common Use Cases

Protecting New Members from Scams

Scenario: Prevent new users from posting links until they're established in the community.

Configuration:

  • Condition: Contains Link + Is New User
  • Action: Delete
  • New User Definition: Joined within 7 days OR Never sent a message

Preventing Spam Mentions

Scenario: Stop mass-mention spam attacks.

Configuration:

  • Condition: Contains Mention
  • Action: Delete
  • Apply to: All users or new users only

Blocking Forward Spam

Scenario: Prevent forwarded spam messages from other groups.

Configuration:

  • Condition: Is Forwarded + Is New User
  • Action: Delete
  • New User Definition: Joined within 3 days

Scenario: Block all links except from trusted domains.

Configuration:

  • Condition: Contains Link
  • Action: Delete
  • Exceptions: Add trusted domains (x.com, your-website.com, etc.)

Best Practices

Effective Filter Management
  • Start with filters for new users only to avoid frustrating established members
  • Whitelist trusted domains before enabling link filters
  • Combine multiple conditions for more precise filtering
  • Use Delete for first offenses, reserve Ban for repeat violations
  • Test filters in a private group before deploying to your main community
  • Regularly review and update domain exceptions
Balance Security and Experience
  • Too strict filters can frustrate legitimate users
  • Always provide domain exceptions for official links
  • Consider user exceptions for team members and trusted contributors
  • Monitor false positives and adjust filters accordingly
  • Communicate filter policies in your community guidelines

Troubleshooting

Legitimate messages being filtered?

  • Check if the user is incorrectly classified as "new"
  • Add necessary domains to domain exceptions
  • Verify user exceptions are configured for trusted members
  • Review filter conditions for overly broad settings

Filters not working?

  • Ensure the bot has admin privileges with delete permissions
  • Verify filters are enabled (not just created)
  • Check if the user is on the user exception list
  • Confirm filter conditions match the message type

Links from trusted domains being deleted?

  • Verify the domain is correctly added to domain exceptions
  • Check domain format (no https://, no trailing slashes)
  • Ensure there are no typos in the domain name
  • Test with a simple domain first

New user definition not working as expected?

  • Review the Mode setting (AND vs OR)
  • Check the time threshold for "Joined within X days"
  • Verify the logic matches your intended behavior
  • Test with a known new user account

Advanced Filtering Strategies

Graduated Permissions

Create a tiered system where new users gain more privileges over time:

Days 0-1: Block links, mentions, and forwards Days 2-7: Allow mentions but block links and forwards Days 7+: Full permissions (no longer "new user")

  1. Block all links by default
  2. Whitelist only verified domains
  3. Regularly audit and update the whitelist
  4. Use triggers to share official links when users ask

Spam Prevention Layer

Combine filters with other features:

  • Filters: Block forwarded messages and links from new users
  • Triggers: Auto-delete spam keywords
  • Captcha: Verify users before they can post
  • User Blacklist: Block suspicious usernames
tip

Remember to give the Fren One bot admin privileges with delete permissions in your chat for all filter actions to work properly.