Discord role bot with a button per role
Post a menu with /rolemenu and members give themselves roles with a click, then take them off with another.
- Plan
- Free, always on
- Setup
- A token, then /rolemenu
- Privileged intents
- None
- Permission
- Manage Roles
What the role bot does
A button for each role
Up to five roles on a menu, each its own button. The first click adds the role and the next one takes it away.
Replies only the member sees
Added or removed is said privately to the person who clicked. Set EPHEMERAL_REPLIES to false and it is said in the channel instead.
As many menus as you need
Run /rolemenu again for pronouns, pings, regions or games. Each menu is its own message and they all keep working.
Nothing to store
Each button carries its role, so there is no database to lose and a redeploy changes nothing.
Set it up
- 1
Create the bot
At discord.com/developers, New Application, then Bot and Reset Token. Copy the token.
- 2
Invite it
With the
botandapplications.commandsscopes and the Manage Roles permission. Then, in Server Settings, Roles, drag its role above the roles it should hand out: Discord only lets a bot give roles below its own. - 3
Deploy it
Press Deploy free, pick the Role Bot template and paste the token. The menu colour is optional.
- 4
Post a menu
Run
/rolemenuwith a title, a line of text if you like, and up to five roles. Members can use it straight away.
Commands
- /rolemenu title role1 [description] [role2 to role5]
- Posts a menu with a button for each role. Only members with Manage Roles can run it.
Environment variables
They live in the table on the bot's page in the panel, values masked once saved. The template's form asks for the ones it needs when you deploy.
| Variable | Needed | What it is |
|---|---|---|
| DISCORD_TOKEN | Required | Your bot token. |
| EMBED_COLOR | Optional | The menu's colour in hex, 5865F2 unless you set one. |
| ACTIVITY | Optional | The bot's status line, Playing Pick your roles unless you set one. |
| EPHEMERAL_REPLIES | Optional | true unless you set it: the Added and Removed replies are private. |
Which plan it needs
The free plan runs it, always on. It keeps nothing in memory beyond the connection to Discord, so the small plan stays small.
Free
Recommended$0
No card
- 256 MB and a quarter of a CPU, always on
- No card: one free bot or app per person
- No renewals. Only a bot with no network traffic for 7 days is stopped
Starter
$2/mo
or $20 a year
- 1 GB of memory and a full vCPU
- Never stopped for being quiet
- You pick the region it runs in
Running more than one? Standard carries two bots or apps for $3 a month and Pro four for $6, on one bill with your game servers. Every plan
Frequently asked questions
How many roles fit on one menu?
Five, one button each. For more, post another menu: every menu works on its own, and members can use them all.
Why does it say it cannot manage a role?
Discord only lets a bot give roles that sit below its own. In Server Settings, Roles, drag the bot's role above the ones on the menu and check that it has Manage Roles.
Is the role bot free?
Yes. It runs on the free plan, always on, with no card. One bot or app is free per person; a second one needs a paid plan, from $2 a month for one or $3 for two.
Can I change what it does?
The colour, the status line and whether replies are private are environment variables. For anything more, fork the repository, change the code and deploy your fork: every push redeploys it.
More ready-made bots
Bringing your own code instead? How a bot deploys from GitHub
Put the role bot in your server
Your first bot is free, with no card. It logs in within a minute.