> For the complete documentation index, see [llms.txt](https://zts-guard.gitbook.io/zts-guard-discord-bot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zts-guard.gitbook.io/zts-guard-discord-bot/setup-anti-link.md).

# Setup Anti-Link

Anti-link enforces link moderation by allowing only approved links to be posted in your Discord server. Any link not on the allow list is automatically deleted and logged in the logging channel.\
\
Meaning no one can send a link if it is not on the allow list, proactively deleting harmful, scam, or bad links from being shared in your Discord server.

{% hint style="info" %}
Only the **Server Owner (Cold Admin)** or registered **Admin** within the ZTS Guard Discord Bot can perform this step.
{% endhint %}

## Steps to setup Anti-Link

{% stepper %}
{% step %}

### Add allowed links

Go to `#ZTS-Guard-Admin` and type `/setup` and select `Manage Anti Link Allowlist` or just type `/anti-link` .  Then enter in any links you want to be allowed to be sent in the server.\
\
You are able to add specific URLs or Top Level Domains (TLDs) that will include all subdomains and URLs of the domain. For example:

| Example Entry format                        | What it allows                                                                 |
| ------------------------------------------- | ------------------------------------------------------------------------------ |
| `zerotrustsecurity.com/`                    | All URLs/Subdomains with that domain are allowed (`*.zerotrustsecurity.com/*`) |
| `https://zerotrustsecurity.com/example/url` | Only that exact URL                                                            |

**Example:**

If you add `zerotrustsecurity.com/`:

* ✅ `https://zerotrustsecurity.com/` — allowed
* ✅ `https://zerotrustsecurity.com/product` — allowed
* ✅ `ZTSguard.zerotrustsecurity.com` — allowed
* ❌ `https://notzerotrustsecurity.com` — blocked
* ❌ `https://zerotrustsecuritywebsite.com/product` — blocked
* ❌ `ZTSguard.zerotrustsecuritywebsite.com` — blocked

{% hint style="info" %}
By default if you add a TLD domain such as `x.com/`, then automatically an entry will also be submitted `*.x.com/*` Therefore you do not have to enter wild card addresses as this is automatically done for you!
{% endhint %}

## Auto-included links

The following links (and wildcards) are automatically on the allow list for Discord and GIF functionality. You have the ability to remove any of these you'd like but these domains are needed for GIFs to be sent and for discord to reference itself within a Discord server:

```
tenor.com/
giphy.com/
media.discordapp.net/
discord.com/channels/
discord.com/guidelines
cdn.discordapp.com/attachments/
discord.com/events/
discordapp.com/
discordstatus.com/
klipy.com/
```

{% endstep %}

{% step %}

### Exempt Channels

Now go to `/setup` → `Anti-Link` menu, select `Manage Exempted Channels` and you can select specific channels or categories from being exempt from Anti-Link enforcement.

{% hint style="info" %}
Exempting a category automatically exempts all channels within it. Be extremely careful with what channels or categories you exempt as any links can then be sent in them. Recommend exempting Team and Logs channels/categories.&#x20;
{% endhint %}
{% endstep %}

{% step %}

### Enable Anti-link

Within the Anti-Link menu select `Enable Warning` so the bot shows a temporary warning message when a link is deleted. You can then input how many seconds a user is timeout for, for violating the Anti-link rules in place.  The time is in seconds and **120 seconds (2 minutes) is  recommended.**\
\
Then within the Anti-Link menu, select `Enable` and this now enables the Anti-Link enforcement and all configuration that has been setup.
{% endstep %}
{% endstepper %}

## Updating the allow list

To add or remove links at any time:

`/setup` → `Manage Anti Link Allowlist` or type /`Anti-link`→ `Manage allowed Links`→Register (add to allow list) or Unregister links (remove from allow list)

<figure><img src="/files/s66wZxI4AUNtNeFHVBpu" alt=""><figcaption></figcaption></figure>
