-
Notifications
You must be signed in to change notification settings - Fork 0
Add Reaction Event
messageReactionAdd is one of Discord's gateway events.
The bot listens to it and triggers a code every time this event happens.
What is the procedure before giving the role by reacting?
- Database check
- Checks of arguments admin has set up
- Giving the role
Once a user posts a response, the bot starts to check eligibility (meet the conditions). In the process, the bot asks these questions:
- Does this Discord server even have a database with me? (have systems ever been created)
- Is this message and response in the database?
After loading the database, check the limit:
- Does this system have a limit of candidates that can get this role?
- If so, is the number of applicants already enrolled greater than or equal to this limit?
After checking the limit, check maxClaims:
ℹ️
maxClaimsis the name of a command argument that specifies the number of how many roles/responses from the entirety of a single message can get.
- Does this system have
maxClaims? - How many times is a candidate registered for different responses in the database?
Once they pass these setup checks, the last questions come up:
- Is there a role from the database?
- Do I have the right to edit the role (in Discord identical to the right to give the role)?
After the last checks, the actual adding of the role occurs:
- Give the role to a candidate
- Write down his Discord ID - a record that he has picked up the role.
- Send a welcome message to the team.
Jump to source code • Jump to wiki home
AdvancedReactions is licensed under the CC BY-SA 4.0 license
© 2024 AdvancedReactions - made by PetyXbron under ArimDev
