Discord roles
Give the members of your Discord server access to an invite-only script by their roles, using your own Discord bot.
If you already run a paid or private Discord server, its roles can unlock your invite-only scripts. A member who holds a mapped role gets access in ChartDeck. When the role is removed, or the member leaves the server, the access they got from it ends. You keep your members, your payment setup and all of your revenue. ChartDeck takes no cut.
ChartDeck does not run a Discord app for you. You connect your own bot: you create it in Discord, add it to your server, and paste its token into ChartDeck. Only your bot reads your server, and only the member list and the roles.
#What you need
- A Discord server where you can manage the server (owner or the Manage Server permission).
- An invite-only script. For a script you sell outside ChartDeck, see Selling access.
- About ten minutes.
#1. Create the bot
- Open the Discord Developer Portal and sign in with your Discord account.
- Click New Application, give it a name (members see this name when they message the bot, for example "Alpha Traders Access") and create it.
- Open Bot in the left menu.
- Under Privileged Gateway Intents, turn on Server Members Intent and click Save Changes. ChartDeck needs this to see who holds which role. The other two privileged intents (Presence, Message Content) stay off.
- Optional but recommended: turn Public Bot off, so only you can add the bot to a server.
- Click Reset Token, confirm, and copy the token. Discord shows it only once. Keep it private: anyone with the token controls the bot.
Interactions Endpoint URL (on the General Information page) is optional. Your connection in ChartDeck shows an address for it: paste it there if you want /link to keep working at times when ChartDeck has no live connection to your bot (the connection card tells you when that is the case).
#2. Add the bot to your server
Copy your Application ID from General Information, put it into this link, and open the link in your browser:
https://discord.com/oauth2/authorize?client_id=<APP_ID>&scope=bot%20applications.commands&permissions=0Pick your server and click Authorize. The bot asks for no permissions (permissions=0): reading members and roles does not need any. The applications.commands scope lets ChartDeck add the /link command to your server.
#3. Connect it in ChartDeck
- In Discord, turn on Developer Mode (User Settings, Advanced). Right-click your server's icon and click Copy Server ID.
- In ChartDeck, open Account, then Selling & access, then Integrations, and choose Discord.
- Paste the bot token and the server ID, then click Connect.
ChartDeck checks the token with a few read-only calls before it saves anything. It confirms that the token belongs to a bot, that Server Members Intent is on, and that the bot is in that server. Then it adds the /link command to your server. The token is stored encrypted and is never shown again: ChartDeck only shows its last four characters.
If the check fails, ChartDeck tells you why:
| Message | What to do |
|---|---|
| Discord did not accept this bot token | Copy the token again (Bot, Reset Token) and paste the new one. |
| This is not a bot token | Use the token from the Bot page, not a user or OAuth token. |
| Turn on "Server Members Intent" | Developer Portal, Bot, Privileged Gateway Intents. Save, then try again. |
| Your bot is not in this server | Add it with the link from step 2 (ChartDeck shows the link), then try again. |
| This connection is for another server | Each server is its own connection. Connect the other server separately. |
#4. Map roles to scripts
Open the connection and choose which role gives which script. ChartDeck lists your server's roles, except @everyone and roles that belong to bots. Several roles can give the same script, and one role can give several scripts.
For each mapping you pick a rule:
| Rule | What it does |
|---|---|
| While they hold the role (default) | Access lasts as long as the member holds the role. When they lose it, or leave the server, access ends after the grace days you set (0 to 30). |
| Fixed term | Each time a member gets the role, they get a term (1 month, 3 months, 1 year or lifetime). Losing the role changes nothing. |
Access a member got another way, such as your own grant, an invite link or a purchase, is never shortened or removed by a Discord role.
#How members connect
Discord does not tell ChartDeck who a member is on ChartDeck, so each member links their Discord account once:
- In ChartDeck, the member opens Account, then Connections, and asks for a Discord link code. It looks like
CDL-ABCD-EFGHand works once, for 10 minutes. - In your server they type
/linkand paste the code. Only they see the bot's answer. Or they send the code to your bot as a direct message. - Back in ChartDeck, under Account → Connections, they confirm that the Discord account is theirs. ChartDeck then checks their roles straight away. (The code alone links nothing, so nobody who sees the code can link an account with it.)
A member links once for all of ChartDeck: if another author's bot already linked their Discord account, your roles count for them too. Members who held a mapped role before they linked get access the moment the link is confirmed.
Tell your members about it in a pinned message or your welcome channel. The script's page also names your server and the roles that give access.
#Keeping it in sync
- Role changes, members joining and members leaving reach ChartDeck within seconds through your bot's connection.
- Every 15 minutes ChartDeck also reads your server's member list to catch anything it missed. On very large servers it reads up to 100,000 members per check and only adds access from that check. Removals still arrive as live events.
- Sync on the connection runs the check right away. Events shows what happened, without any member's private details.
- If you delete a mapped role in Discord, the members who held it lose that access, and the connection's events ask you to update your mappings.
#Changing or removing the bot
- Update credentials takes a new token for the same server, for example after Reset Token. Use it after you turn on Server Members Intent, too, with the same token.
- Disconnect removes the
/linkcommand, closes the bot's connection and ends every access the connection gave. Access from other sources stays. - If Discord stops accepting the token (it was reset, or the bot was deleted), the connection shows an error until you update the credentials. Members keep their access until a sync can run again.
#Privacy and limits
- ChartDeck reads only your server's roles, its members' user IDs and roles, and direct messages that members send to your bot. It never posts in your channels and needs no permissions.
- The bot answers a direct message only to confirm a link or explain how to get a code. It never repeats a member's code.
- You can connect up to 5 Discord servers. Each one can have up to 100 mappings.