> ## Documentation Index
> Fetch the complete documentation index at: https://chainpatrol-knowledge-update-blockaid-and-hypernative-partn.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Discord Bot

> A Discord bot that can be used submit scam reports to ChainPatrol

<Frame>
  <img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-bot.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=d35a590891aa209e9f75911137508362" alt="ChainPatrol Discord Bot" width="1200" height="900" data-path="images/discord-bot.png" />
</Frame>

If you have a **Discord server**, you can use the [ChainPatrol Discord bot](https://chainpatrol.com/bot)
to let your server members submit scam reports to **ChainPatrol**. The bot will generate new
reports that get sent to your admin dashboard for review.

## Setup

<Tip>
  If you have a dedicated `scam-reports` channel, we recommend pinning a message
  in this channel and directing your server members to use the bot there for
  easy reporting
</Tip>

### Install the bot

To add the bot to your server, you need to be an admin of the server. Then, you
can use the following link to add the bot:

[🚀 Add ChainPatrol to your server](https://chainpatrol.com/bot/install)

Next, you need to configure the bot to send reports to your admin dashboard on ChainPatrol. Right now,
this is can be done by reaching out to us [via email](mailto:support@chainpatrol.io?subject=%5BDiscord%20Bot%5D%20Setup%20integration%20with%20ChainPatrol\&body=Hi,%20I%20would%20like%20to%20link%20the%20Discord%20bot%20to%20my%20ChainPatrol%20account%20as%20described%20here:%20https://chainpatrol.io/docs/general/discord-bot.%0A%0AThanks!)
and letting us know that you want to add the bot to your server. We will create an organization
for you on ChainPatrol and you can then use the `/setup connect` slash command to link your Discord server
to your organization on ChainPatrol.

To check that the bot is working, you can use the `/setup status` command to see if the bot is
connected to your ChainPatrol organization.

## Features

### Scam Reports

The bot allows server members to submit scam reports directly to ChainPatrol.

#### Usage

Once the bot is added to your server, you can use the following commands:

* `/report <url>` - Submit a scam report for the given URL
* `/check <url>` - Check if the given URL is a scam

#### Example

Here is an example of how to use the bot to submit a scam report:

<img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-bot-prompt.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=0c2c0f5a97b81100b23635fe874445a6" alt="Example of using the ChainPatrol Discord bot" width="772" height="236" data-path="images/discord-bot-prompt.png" />

<img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-bot-loading.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=5cba55fe38c0065ae1d9822a2d1d3038" alt="Loading of the ChainPatrol Discord bot" width="744" height="212" data-path="images/discord-bot-loading.png" />

<img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-bot-success.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=684dcd40a52b7305448c60c349d97d44" alt="Success of the ChainPatrol Discord bot" width="648" height="196" data-path="images/discord-bot-success.png" />

### Reports Feed

You can create a feed channel of all reports to your organization. This feature allows you to see all scam reports submitted through the bot in a dedicated channel.

#### Setup

1. Create a new channel on your Discord server and name it something like `chainpatrol-reports`
2. Use the following command to link the channel to your ChainPatrol organization:
   ```
   /setup feed <channel>
   ```
3. Follow the instructions in the bot's response to link the channel to your ChainPatrol organization

<img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-bot-feed-setup.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=23a522f0b69fd1a873b3586ec30af6a4" alt="Image showing the Discord bot's response to the setup feed command" width="1776" height="378" data-path="images/discord-bot-feed-setup.png" />

You can check that the feed is connected correctly by running the `/setup status` command. If the
feed is connected correctly, you should see the channel name in the bot's response.

<img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-bot-feed-status.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=aa68cb914b6e0a4e2f1984c0cd60c4d9" alt="Image showing the Discord bot's response to the setup status command after setting up the feed" width="1558" height="248" data-path="images/discord-bot-feed-status.png" />

As a final test, you can try submitting a test scam report using the `/report` command. You should see a message
in the feed channel with the scam report shortly after submitting.

<img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-bot-feed.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=a332eac04376452ca03a7041d6e97d37" alt="Example of the feed channel" width="1272" height="1240" data-path="images/discord-bot-feed.png" />

### Link Monitoring

ChainPatrol can monitor your Discord channels for suspicious links and automatically take action when they are detected. This feature helps protect your community from scams and malicious content.

#### Setup

To enable link monitoring in a channel:

1. Navigate to the channel you want to monitor
2. Run the `/setup linkmonitoring` command
3. Confirm the setup when prompted

<Tip>
  Only server administrators or users with "Manage Server" permissions can
  enable link monitoring
</Tip>

#### How it Works

Once enabled, ChainPatrol will:

1. Monitor all messages in the configured channel for URLs
2. Check each URL against ChainPatrol's comprehensive blocklist, which includes:
   * Known scam websites
   * Phishing attempts
   * Malicious domains
   * Other security threats reported to ChainPatrol
3. Take action based on your server's configuration when suspicious links are detected

<Tip>
  The blocklist is continuously updated with new threats reported by the
  ChainPatrol community and security researchers. You can [search through our
  blocklist](https://app.chainpatrol.io/search) to see what threats we're
  protecting against.
</Tip>

#### Response Actions

When a suspicious link is detected, ChainPatrol can be configured to:

* **React with 🚨** - Adds a warning reaction to the message
* **Delete the message** - Automatically removes the message
* **Notify moderators** - Sends an alert to your moderator channel

<Tip>
  The response action is configured by your server administrator through the
  ChainPatrol dashboard
</Tip>

#### Example

Here's what happens when a suspicious link is detected:

<img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-bot-link-monitoring.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=ebce29daf736455ae1687cea15996c07" alt="Example of link monitoring in action" width="480" height="247" data-path="images/discord-bot-link-monitoring.png" />

## Common Issues

<Frame>
  <img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-application-no-response.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=6d5a4adc3f611f1f7460cb7530c5deba" alt="no-response" width="678" height="208" data-path="images/discord-application-no-response.png" />
</Frame>

### Custom Elevated Permissions

* Bot role may need elevated permission to interact with private channels

* If you are adding the bot to a channel that is not normally visible to `@everyone`, then you will need to
  Slash commands not visible to Discord members

  <CardGroup cols={2}>
    <Card title="Private Channel Permissions" icon="square-1">
      <Frame>
        <img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-private-channel.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=a29179376924cb4c7b4fe7e434d72a8e" alt="Kebab Menu" width="2186" height="1198" data-path="images/discord-private-channel.png" />
      </Frame>
    </Card>

    <Card title="Adding ChainPatrol Bot" icon="square-2">
      <Frame>
        <img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-select-app.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=e3f23209d40379c3f920fef443e593a6" alt="Report Modal" width="874" height="948" data-path="images/discord-select-app.png" />
      </Frame>
    </Card>
  </CardGroup>

* Embed links permissions are required for your reports feed

  <Frame>
    <img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-channel-embed-links.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=2aa013fcf967888c29a244abd0b42578" alt="channel embeds" width="2134" height="1318" data-path="images/discord-channel-embed-links.png" />
  </Frame>

* Make application commands available to users
  * Server members will not be able to use the ChainPatrol bot commands if they do not have access to application commands
    <Frame>
      <img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-application-comands.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=4fce300be36b8439414c2a64af694cd0" alt="application commands" width="2106" height="1276" data-path="images/discord-application-comands.png" />
    </Frame>

## Debugging Tips

### View Server As Role

* You can right click the ChainPatrol role in server settings to see the server as the bot role

  <Frame>
    <img src="https://mintcdn.com/chainpatrol-knowledge-update-blockaid-and-hypernative-partn/_tYYcGUrxMX8hzq_/images/discord-view-as-role.png?fit=max&auto=format&n=_tYYcGUrxMX8hzq_&q=85&s=6c4eca91c621e333caab4fcb4724d270" alt="view as role" width="2162" height="1382" data-path="images/discord-view-as-role.png" />
  </Frame>

<Tip>
  Trying to access a feature in an inaccessible part of the server will lead to
  an error. Make sure the bot's permissions can see and interact with what you
  are debugging.

  Check out [Discord's Role Management 101](https://support.discord.com/hc/en-us/articles/214836687-Role-Management-101) Article for additional help!
</Tip>

## Privacy

The bot does not collect any personal information. It only collects the URL and
the Discord ID for the user that submitted the report (in case a moderator needs
more information about why the URL is a scam). The bot does not store any information
about the server it is added to.

## Source Code

The source code for the bot is available on GitHub:
[chainpatrol/discord-bot](https://github.com/chainPatrol/discord-bot)
