How to make a Discord quiz bot that gives a role
Use a Quiz Roles question as a lightweight rules or acknowledgement gate. A manager publishes one question with two to four button choices. Each member gets one saved answer, and a correct answer prompts the bot to grant the selected role.
Start freeStart free. Pro is $9.99/month.
Before you start
- Have a Build Discord Bots bot online in the server you manage. Quiz Roles is a Free module, but it is off for each server until you enable and save it in the dashboard.
- Create an ordinary reward role such as Quiz Passed. The bot needs Manage Roles, and its highest Discord role must be above that reward role.
Use a quiz as a lightweight rules or acknowledgement gate
Use this one-question flow when a member needs to acknowledge a rule or a simple instruction before receiving an ordinary role.
Open the bot’s Modules tab, turn on Quiz Roles if it is not selected, then use the module card’s Settings button. Choose the server in the Server selector, turn on Enable in this server, and save. The per-server switch is deliberately off by default, including for existing bots, so publishing is unavailable until that saved setting is on.
The same settings let you choose an optional Default quiz channel and Quiz manager role. Members with Manage Server or the configured Quiz manager role can run /quizrole create, /quizrole list, and /quizrole close.
Create a safe reward role and fix role hierarchy
Use a dedicated, ordinary reward role. The bot checks Manage Roles and confirms its highest role is above the reward role both at creation and after a correct answer.
The reward role must also sit below the quiz manager’s highest role unless the manager owns the server.
Publish one question with 2–4 buttons
In Discord, run /quizrole create with question, options, correct, and role. Enter two through four distinct choices in options, separated by |. In correct, enter the number of the right choice, starting at 1. Use role to select the reward role.
Use the optional channel field to pick a text or announcement channel. If you leave it blank, the bot posts in the saved Default quiz channel or, if that is unset, in the channel where you run the command. You and the bot need to be able to view the destination, and the bot needs to be able to send messages there.
Test a wrong answer, a correct answer, and the saved one-attempt result
Each member’s first selection is saved for that quiz, whether it is right or wrong. The one-attempt limit is fixed. Quiz Roles has no setting to allow retries.
Check that the member who answers correctly gets Quiz Passed. If the bot cannot grant the role, the member still uses their attempt. Check Manage Roles and the bot’s role order before publishing a replacement quiz.
Close quizzes and understand Free/Pro active-quiz limits
Run /quizrole list to privately review active questions with their reward roles and saved attempt and correct counts. The current Free plan permits one active quiz per server. Pro permits up to 10 active quizzes per server. Both plans give each member one attempt per quiz.
To close quiz 12, run /quizrole close id:12. Use the id from your own quiz. Closing stops new answers and frees an active-quiz slot. Turning off Quiz Roles for the server also pauses answers.
Worked example: give Quiz Passed for a correct answer
A staff member with Manage Server runs /quizrole create question:Where do you post an introduction? options:Introductions | General correct:1 role:@Quiz Passed channel:#welcome. The bot posts one question with two buttons in #welcome.
Sam presses “1. Introductions” and gets the Quiz Passed role. The bot confirms the grant in a private reply.
Jordan presses “2. General,” gets no reward role, and sees a private reply in English: “That answer is not correct. You have used your one attempt.” If Jordan presses another button while the quiz is open, the bot replies privately, “You have already used your one attempt for this quiz.”
Frequently asked questions
Can a member retry?
No. A quiz published with /quizrole create saves each member’s first answer, right or wrong. The one-attempt limit is fixed.
Is this a multi-question exam?
No. Use /quizrole create to publish one question with two to four choices.
Does a failed role grant consume the answer?
Yes. The first selection is saved before the module attempts the role grant. If you need a fresh attempt, fix Manage Roles or the bot’s role order and publish a new quiz with /quizrole create.
Does closing remove roles?
No. Run /quizrole close with the quiz’s id to stop new answers and free an active-quiz slot. Members keep the roles they earned.
