Token-gate a Discord server

Give Discord roles to ERC-20 token or NFT holders on any of 50 EVM mainnets, and have Guild remove them when someone sells.

To token-gate a Discord server with Guild, create a guild, add a role whose requirement is a token or NFT balance (for example "hold at least 1 of our NFTs" or "hold 1,000 of our token"), and give that role a Discord reward that assigns a Discord role. Members connect their wallets and their Discord account to Guild and claim the role; when their wallets meet the requirement, Guild's bot gives them the Discord role, and when they sell or transfer below it, the bot takes the role away. Token and NFT requirements work on 50 EVM mainnets, and Discord gating is part of the free plan.

What you need

  • A Discord server you own or have the Administrator permission in.
  • The contract address of your token or NFT collection, and the chain it lives on.
  • A guild. If you don't have one yet, start at /create.

1. Create the role

  1. On your guild, choose Manage guild in the sidebar to open the admin panel.
  2. Open Spaces & roles and choose New role, then Empty role.
  3. Give the role a name, such as "Holders", and press Save.

2. Add the token or NFT requirement

  1. In the role's inspector, under Who gets it, press Requirement.
  2. For an ERC-20 token, pick Token balance and choose ERC20 balance under What to check. For a chain's native coin, such as ETH, choose Native currency balance. For an NFT collection, pick NFT Balance.
  3. Pick the chain, then paste the contract address. Guild shows the token's name and symbol once it recognizes the address.
  4. For an NFT, leave the token ID empty to count any NFT from the collection, enter one Token ID, or switch to Multiple Token IDs and paste a list.
  5. Set the balance and how to compare it, for example at least 1. Enter amounts as a wallet shows them, not in the token's smallest unit.
  6. Press Add requirement.

By default a member meets an NFT requirement if one of their connected wallets holds enough. Tick Sum across connected wallets to add up all their wallets instead. See Tokens and NFTs for every field.

3. Cover more than one chain

Each requirement checks one contract on one chain. If your token or collection is on several chains, add one requirement per chain, then set Members should meet to Any one and press Save, so holding on any of them is enough. The same project often has a different address on each chain.

All means "hold the NFT and the token", and Group builds rules like "hold the NFT, or hold the token on Base and on Ethereum". To build tiers, create one role per tier, each with its own balance and its own Discord role. Supported chains lists which chains support balance requirements.

4. Connect Discord and add the reward

  1. In the same role, under Unlocks, press Add reward and pick Discord. Connect Discord to your Guild account if you haven't yet.
  2. Under Add new server, pick your server. If Guild's bot isn't in it, Discord opens in a new tab to invite it. Authorize it and come back; the server is added once the bot has joined.
  3. Choose New role to have Guild create a Discord role with the name you enter, or Existing role to use one already in your server.
  4. Leave Keep role once earned off for holder roles, so the Discord role is removed when someone stops holding. Switch it on only for roles members should keep, such as an achievement.
  5. Press Add reward.

Then, in your Discord server settings under Roles, drag the Guild.xyz bot role above every role Guild manages. Discord only lets a bot manage roles below its own. More detail is on Discord rewards.

5. Share the link

Choose View as member in the admin sidebar to check the role reads as you meant. Then post your guild's link (guild.xyz/ followed by its URL name) in a channel new members see, such as a pinned message in a "get-roles" channel.

How roles stay up to date

Guild gives the Discord role to members who claim it: on joining from your guild's page, or later with Check access, for example after buying the NFT. After that you don't check wallets by hand:

  • Guild refreshes the onchain data behind requirements in the background, so a sale or transfer reaches Guild without anyone pressing a button.
  • When a member's balance drops below the requirement, they lose the Guild role and the bot removes the Discord role, unless Keep role once earned is on.
  • When a member leaves the guild, every Discord role it gave them is removed, including kept ones.
  • If Guild temporarily can't read a member's data, it keeps the roles they already have instead of taking them away. It never grants a role on missing data.

Adding a requirement to a role people already hold removes it, and its Discord role, from anyone who doesn't meet the new one when they are next checked.

FAQ

Is token-gating Discord free on Guild?

Yes. Token and NFT requirements and Discord role rewards are available on the free plan. Paid plans add features such as hidden and secret roles, member analytics and forms; see the pricing page.

What happens when someone sells their NFT or tokens?

Once Guild's refreshed data shows the drop, they lose the role and its Discord role, unless Keep role once earned is on for that reward.

Can a member use more than one wallet?

Yes. One Guild account can hold several connected wallets, and Guild checks all of them. By default one wallet must hold enough on its own. For NFT requirements you can tick Sum across connected wallets to add them up; token and coin balances have no such option.

Why didn't a member get their Discord role?

The usual causes are a Discord account not connected to Guild, a member who hasn't claimed the role since they qualified (they press Check access), or the Guild.xyz bot role sitting below the role it should assign. Once the bot's role is high enough, the member can press Reclaim on the reward to have Guild assign it again.

Can I require that people held the token for a while, not just today?

Yes, on Ethereum and Base. Use a holding history requirement, Held at a past block or Held continuously for, instead of a plain balance.

All Guild docs