> For the complete documentation index, see [llms.txt](https://docs.heymint.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.heymint.xyz/discord-bot-integration/token-gating.md).

# Token Gating

This guide will show you how to set up HeyMint's Discord bot to grant the token holder role automatically.

Our Discord bot verifies token ownership to easily grant a **token holder role** to your Discord community members.&#x20;

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2F3quK00eFchJRuwY4BOnU%2FScreenshot%202024-05-09%20at%209.16.47%E2%80%AFAM.png?alt=media&amp;token=35b1038c-f1f9-46b3-b4d8-f83dc777df34" alt="" width="554"><figcaption></figcaption></figure>

**Here's what you'll need:**

* A Discord server with your desired role structure (the HeyMint bot's role must be above the selected role in the Discord role hierarchy. Otherwise, the bot will be unable to assign the role. )

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2FFss3y8ZTCZ4NbAiQv8iO%2FScreenshot%202024-05-09%20at%209.36.03%E2%80%AFAM.png?alt=media&amp;token=316c65ca-70a9-4ee8-9c81-36027db9f2c0" alt=""><figcaption></figcaption></figure>

* A [HeyMint account](https://docs.heymint.xyz/create-an-allowlist.md) and an existing allowlist project

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2Fe7HIeBzVwNDtWPtHqiPf%2FScreenshot%202024-05-09%20at%209.52.04%E2%80%AFAM.png?alt=media&amp;token=6d66185a-7ce5-492d-af32-f57b7659d0f2" alt=""><figcaption></figcaption></figure>

### Steps

#### **Step 1: Discord Token Gating**

a. In your HeyMint allowlist, navigate to the **Discord** tab.

b. Click on **Token Gating** and then **Start Here**.

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2FVubj9aYEJDWYdk8OKY3V%2FScreenshot%202024-05-09%20at%207.18.48%E2%80%AFAM.png?alt=media&amp;token=05a0e252-60d6-4889-a264-27d182db2b3d" alt=""><figcaption></figcaption></figure>

c. Choose your preferred login method (Google or Discord).

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2Fh1NnmtfNoeZe0NOWqubF%2FScreenshot%202024-05-09%20at%209.44.35%E2%80%AFAM.png?alt=media&amp;token=11345b2c-093b-4b0b-a44b-666a821c6ffd" alt=""><figcaption></figcaption></figure>

#### **Step 2: Connect & Authorize HeyMint Bot in Discord**&#x20;

(This step will involve granting permissions to the HeyMint bot within your server.)

#### **Step 3: Configure Token Gated Role**

a. Select the Discord server where you want to apply token gating.

b. Choose the onboarding channel (where users will connect wallets to verify ownership) and then click on "Post onboarding message".

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2FJ4UXToZaeRvgEabMrvoN%2FScreenshot%202024-05-09%20at%209.09.28%E2%80%AFAM.png?alt=media&amp;token=51614507-fd5b-401a-a8cd-393b6d2f4e61" alt=""><figcaption><p>Select onboarding channel</p></figcaption></figure>

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2F6aijn1KPv022JzQkcaRm%2FScreenshot%202024-05-09%20at%209.10.37%E2%80%AFAM.png?alt=media&amp;token=7815c624-ee81-4c08-9543-0b2403c20cff" alt=""><figcaption><p>Post onboarding message</p></figcaption></figure>

c. Go to the **Role Verification** section, select which ecosystem your community is in (Ordinals, BRC-20, EVM NFT for EVM chains like ETH, Polygon, Base etc, or RUNE), and then configure your role verification settings.

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2F00rcxD8ZqyTSZwjkGszk%2FScreenshot%202024-05-09%20at%209.32.53%E2%80%AFAM.png?alt=media&amp;token=738ce71c-eb03-4473-b29d-f1c4bdc691f6" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2FJuhpnrp3J0UDs9lH2S2h%2FScreenshot%202024-05-09%20at%209.33.51%E2%80%AFAM.png?alt=media&amp;token=3d212731-7146-444e-a014-5086d6fcf1c9" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
*Please be sure that the bot's role is above the selected role in the Discord role hierarchy.*&#x20;

*Otherwise, the bot will be unable to assign the role.*

<img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2FFss3y8ZTCZ4NbAiQv8iO%2FScreenshot%202024-05-09%20at%209.36.03%E2%80%AFAM.png?alt=media&amp;token=316c65ca-70a9-4ee8-9c81-36027db9f2c0" alt="" data-size="original">
{% endhint %}

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2FEBC2M4ZKTSQv2nF9PkNA%2FScreenshot%202024-05-09%20at%209.37.20%E2%80%AFAM.png?alt=media&amp;token=ff597ab6-d563-4c7a-845f-8b6bce465f32" alt=""><figcaption></figcaption></figure>

#### **Step 4: Spread the Word**&#x20;

Let your collectors know they can automatically receive the holder role you set (you can set any name for the role in the settings above) by connecting their wallets to the bot in your Discord server.&#x20;

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2F3quK00eFchJRuwY4BOnU%2FScreenshot%202024-05-09%20at%209.16.47%E2%80%AFAM.png?alt=media&amp;token=35b1038c-f1f9-46b3-b4d8-f83dc777df34" alt="" width="554"><figcaption></figcaption></figure>

#### **Step 5: Refresh roles**&#x20;

After connecting the wallet holding the token, users can click on the "Refresh roles" button for their role/s to be added.

<figure><img src="https://1402073043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPHRJcSxfS9ww6PxcamZo%2Fuploads%2FHDC0jKlEC91kn6gan4Lx%2FScreenshot%202024-05-09%20at%209.41.01%E2%80%AFAM.png?alt=media&amp;token=55653e15-96e6-41d2-a1c6-21a2fc20210b" alt=""><figcaption></figcaption></figure>
