# Blacklist

{% hint style="success" %}

### **Download Mobile App or use Web**

✅ **iOS** → [App Store](https://apps.apple.com/us/app/autoforward-for-telegram/id6447486093)\
✅ **Android** → [Google Play](https://play.google.com/store/apps/details?id=com.autoforward.telegramforward)\
✅ **Web** → [web.autoforwardtelegram.com](https://web.autoforwardtelegram.com/)
{% endhint %}

Here is the **Blacklist** documentation based on the structure and details provided for the Whitelist feature:

***

## **Blacklist: Block Messages Based on Words, Patterns, or Users**

The **Blacklist** feature allows you to define a list of blocked users, groups, or channels whose messages will not be forwarded. This ensures that unwanted content from specific sources is excluded from the forwarding process, helping you maintain control and relevance in message flow.

***

## **How It Works**

* When you add a user, group, or channel to the **Blacklist**, their messages will be blocked.
* Messages from sources **on the Blacklist** will not be forwarded.
* If no Blacklist is set up, messages from all sources will be forwarded (unless other filters like Whitelist are applied).

***

## **1. Accessing the Blacklist Feature**

#### **On Mobile App**

1. Open the [Auto Forward mobile app](https://docs-v2.autoforwardtelegram.com/mobile-app/how-to-download-app-for-mobile).
2. Go to the **Dashboard**.
3. Tap on the **Blacklist** icon.

<div align="left"><figure><img src="https://3402573870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FddnL4cgrrb4y0Pnwxc5r%2Fuploads%2FZJgag1a0OhgCFWoGLmiK%2Fimage.png?alt=media&#x26;token=8fce9bfb-6cda-4205-83c7-fc83f2f7124b" alt="" width="375"><figcaption></figcaption></figure></div>

***

#### **On Web Dashboard**

1. **Log in to the** [**Auto Forward Web**](https://web.autoforwardtelegram.com/) **Dashboard.**
2. In the left-hand menu under **Features**, click on **Blacklist**.

<div align="left"><figure><img src="https://3402573870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FddnL4cgrrb4y0Pnwxc5r%2Fuploads%2FjPY0Grj1uDa2Wo61caq3%2Fimage.png?alt=media&#x26;token=f90fe524-61ec-4894-8f55-0266487f17f4" alt="" width="375"><figcaption></figcaption></figure></div>

***

#### **Next Step**

Tap on the **Add New** button to create a new Blacklist rule.

<div align="left"><figure><img src="https://3402573870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FddnL4cgrrb4y0Pnwxc5r%2Fuploads%2F1QM6F2E3x5WmANZyyJCL%2Fimage.png?alt=media&#x26;token=a06ca591-d89c-4ad0-9453-927fd39e5a16" alt="" width="375"><figcaption></figcaption></figure></div>

***

## **2. Create Blacklist Rule**

<figure><img src="https://3402573870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FddnL4cgrrb4y0Pnwxc5r%2Fuploads%2F9u02rzF8aYBt6Jtd6HIo%2Fimage.png?alt=media&#x26;token=73929a5f-e654-4f3b-8764-8ec1c0efcba0" alt=""><figcaption></figcaption></figure>

#### **Options for Blacklist Apply To**

1. **Post:**&#x20;

   ```
   Check each message one by one — both original posts and replies.
   ```
2. **Reply:**&#x20;

   <pre data-overflow="wrap"><code>Check only the first post in a thread. If it matches, all its replies will not be forwarded.
   </code></pre>

#### **Options for Blacklist Type**

You can choose one of the following Blacklist Types:

1. **Basic**: Add simple words or phrases to the Blacklist.
2. **Regex**: Use Regular Expressions (Regex) for advanced filtering.
3. **Blacklist By User**: Block messages from specific users.

***

#### **Steps to Create a Blacklist Rule**

**1. Enter a Label**

* Add a Label to identify your Blacklist rule.
* **Example**: `block_words`, `remove_links`.

**2. Select Blacklist Type**

* **Basic**: Enter one or more words (separate them with commas).
  * **Example**: `spam,ad,unwanted`.
* **Regex**: Use a regex pattern for advanced filtering.
  * **Example**: `\bunwanted\b` (matches the word "unwanted" fully).
* **Blacklist By User**: Add usernames or user IDs to block specific senders.

**3. Full Content (Optional)**

* Paste the original content to test or match against the rule.

**4. Apply to Tasks (Optional)**

* In the **Apply For Task** field, select a specific task if needed.

**5. Save the Rule**

* Tap **Create Blacklist** to save and activate the rule.

***

## **3. Blacklist Types**

### **1. Basic Blacklist**

The **Basic Blacklist** allows you to block messages containing specific words or phrases.

**Steps to Use**

1. Go to **Blacklist** → Tap **Add New**.
2. Select **Basic** in the **Blacklist Type** dropdown.
3. Add the words/phrases to the **Content Blacklist** field.
4. Tap **Create Blacklist** to save.

<figure><img src="https://3402573870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FddnL4cgrrb4y0Pnwxc5r%2Fuploads%2Fg4dDVmsMeYjRgsiHTOb3%2Fimage.png?alt=media&#x26;token=f3b208cd-ff06-4a35-869f-912f0aa9f2b4" alt=""><figcaption></figcaption></figure>

***

**Example Scenarios**

1. **Block messages containing "spam" or "ad"**
   * **Content Blacklist**: `spam,ad`
   * **Example Message**:

     ```
     This is a spam message with an ad.  
     ```
   * **Result**: Blocked ❌
2. **Block messages containing "promotion" or "unsubscribe"**
   * **Content Blacklist**: `promotion,unsubscribe`
   * **Example Message**:

     ```
     Check out our latest promotion! Unsubscribe anytime.  
     ```
   * **Result**: Blocked ❌

***

### **2. Regex Blacklist**

The **Regex Blacklist** is used for advanced matching. allows you to match complex patterns, not just exact words — giving you more control and flexibility when filtering.

{% hint style="info" %}
Using Regex requires basic knowledge of regular expressions. If you’re unsure, use Simple Mode instead.

> Need help with Regex? Test patterns at [regex101.com](https://regex101.com) or learn from [regexone.com](https://regexone.com)
> {% endhint %}

If you’re not confident with writing regular expressions, you can ask AI platforms to help you generate them.

Recommended tools:

* 🧠 [ChatGPT](https://chat.openai.com) – just ask:

  > *E.g: “Write a regex to match hashtags starting with # and ending with space.”*
* 🤖 [Google Gemini](https://gemini.google.com)

🔍 These tools can explain, test, and even fix your regex patterns for you.

**Steps to Use**

1. Go to **Blacklist** → Tap **Add New**.
2. Select **Regex** in the **Blacklist Type** dropdown.
3. Enter the **Regex pattern** in the **Content Blacklist** field.
4. Tap **Create Blacklist** to save.

<figure><img src="https://3402573870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FddnL4cgrrb4y0Pnwxc5r%2Fuploads%2FzYKOo7fbyzjm7L1HwfpQ%2Fimage.png?alt=media&#x26;token=af903976-fe4c-4ce2-98ee-eb10f1122d1e" alt=""><figcaption></figcaption></figure>

***

**Combine Conditions with AND/OR**

* **AND Condition**: All specified conditions must be met.
* **OR Condition**: Any one of the specified conditions must be met.

<figure><img src="https://3402573870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FddnL4cgrrb4y0Pnwxc5r%2Fuploads%2Fd0ZsACpY1wYdfSoTKQhx%2Fimage.png?alt=media&#x26;token=576b8909-6891-4f74-a3d8-27d8b95946a5" alt=""><figcaption></figcaption></figure>

#### **What are AND and OR Conditions?**

1. **AND Condition**:
   * Ensures that all specified conditions must be met for a message to be blocked.
   * Example: A message must contain **"buy"** **and** **"cheap"** to be blocked.
2. **OR Condition**:
   * Ensures that any one of the specified conditions is met for a message to be blocked.
   * Example: A message must contain **"spam"** **or** **"ad"** to be blocked.

#### **How to Add AND/OR Conditions**

1. **Add an AND Condition**:

   * Tap the **+ AND** button to add another condition that must also be met.
   * **Example**: After entering `buy`, add `cheap`.

   **Result**: Messages containing both **"buy"** **and** **"cheap"** will be blocked.
2. **Add an OR Condition**:

   * Tap the **+ OR** button to add another condition where either can be met.
   * **Example**: After entering `spam`, add `ad`.

   **Result**: Messages containing either **"spam"** **or** **"ad"** will be blocked.

<figure><img src="https://3402573870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FddnL4cgrrb4y0Pnwxc5r%2Fuploads%2FFvDLY1YfUu5xgWsbmz1a%2Fimage.png?alt=media&#x26;token=2f338df2-c6f4-4e9d-bf35-4e9b2383165e" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
If your pattern includes special characters (like ., +, or spaces), escape them with \\. Example: x5\\+, hello\ world.
{% endhint %}

**Example Scenarios**

1. **Block messages containing links**
   * **Regex Pattern**:

     ```regex
     (http|https|www)\S+  
     ```
   * **Example Message**:

     ```
     Visit https://example.com for more info.  
     ```
   * **Result**: Blocked ❌
2. **Block messages containing "scam" or "fraud"**
   * **Regex Pattern**:

     ```regex
     (scam|fraud)  
     ```
   * **Example Message**:

     ```
     This is a fraud alert.  
     ```
   * **Result**: Blocked ❌
3. **Block messages containing both "buy" and "cheap"**
   * **Regex Pattern**:

     ```regex
     ^(?=.*\bbuy\b)(?=.*\bcheap\b).*  
     ```
   * **Example Message**:

     ```
     Buy this product for a cheap price!  
     ```
   * **Result**: Blocked ❌

#### **Example Scenarios Combine Multiple AND/OR Conditions**

1. **Block Messages Containing Both "buy" and "cheap"**
   * **Condition**:
     * **Content Blacklist**: `buy`
     * Add Condition: **+ AND** → `cheap`
   * **Example Message**:

     ```kotlin
     kotlinSao chép mãBuy this product for a cheap price!  
     ```
   * **Result**: Blocked ❌
2. **Block Messages Containing Either "spam" or "ad"**
   * **Condition**:
     * **Content Blacklist**: `spam`
     * Add Condition: **+ OR** → `ad`
   * **Example Message**:

     ```csharp
     csharpSao chép mãThis is a spam message with an ad.  
     ```
   * **Result**: Blocked ❌
3. **Combine Multiple AND/OR Conditions**
   * **Condition**:
     * **Content Blacklist**: `buy`
     * Add Condition: **+ AND** → `cheap`
     * Add Condition: **+ OR** → `scam`
   * **Example Messages**:
     * `Buy this product for a cheap price!`: Blocked ❌
     * `This is a scam message`: Blocked ❌
     * `Buy now`: Not Blocked ✅

***

### **3. Blacklist By User (Platinum Plan Only)**

The **Blacklist By User** feature allows you to block messages from specific users, channels, or groups.

***

**How to Use Blacklist By User**

1. Use the **`/getid`** command to find the **User ID** of the sender.
   * **Example**:

     ```
     /getid  
     ➡️ User ID: 123456789  
     ```
2. Go to **Dashboard** → Tap on **Blacklist** → **Add New**.
3. Select **Blacklist By User** as the Blacklist Type.
4. Enter the **User ID** (e.g., `123456789`) or the **Username** (e.g., `@blocked_user`).
5. Tap **Create Blacklist** to save the rule.

***

**Example Scenario**

* **Use Case**: Block messages from a spammer.
* **Content Blacklist**: `123456789` or `@spammer_user`.
* **Result**: Messages from the user will be blocked.

***

### **4. Apply/Disable Blacklist For a Task**

#### **Steps**

1. From the **Dashboard**, select the **Blacklist** feature.
2. Locate the Blacklist rule you want to manage.
3. Tap on the rule to open the **popup window**.

#### **Options**

1. **Activate/Deactivate For Task**: Enable or disable the rule for a specific task.
2. **Apply For All Tasks**: Apply the rule globally across all tasks.
3. **Edit Blacklist**: Update keywords, regex patterns, or user IDs.
4. **Delete**: Permanently remove the rule.

***

### **5. Tips for Using Blacklist**

* Use **Basic** for simple word-based filtering.
* Use **Regex** for complex patterns like URLs, mentions, or phrases.
* Regularly review and update Blacklist rules for optimal performance.
* Test Regex patterns using [regex101.com](https://regex101.com/).

***

### **Why Use Blacklist?**

* Prevents unwanted content from being forwarded.
* Blocks spam and irrelevant messages.
* Ensures better control over message forwarding.

***

With the **Blacklist** feature, you can effectively block messages based on words, patterns, or specific senders, ensuring only relevant content is forwarded. 🚀
