A Discord bot that randomly spawns a self-assignable, temporary role on a timer.
-
Follow the instructions in create-discord-bot.
Don't forget to give your bot the
Manage Roles
permission! -
Download this bot and move the
src-discord-superactive-role-bot
folder into the /src/bots folder from step 1. -
Open config.json to configure your own settings:
[ { "emoji": "🅱️", "roleId": "738466795341479997", "guildId": "258167954913361930", "channelIds": [ "258167954913361930", "418990932399226882", "264627745177206786", "419681885166239744", "747319121582096434", "842667470900822028", "755818716641624104", "266041562033553408", "765411104372817990", "755136985856737321" ], "maxRoleUsers": 3, "openText": "React to claim {role}!", "claimCloseText": "{users} claimed {role}!", "noClaimCloseText": "No one claimed {role}...", "role": { "minDuration": 3000000, "maxDuration": 4200000 }, "messageOpen": { "minDuration": 600000, "maxDuration": 600000 }, "messageClose": { "minDuration": 300000, "maxDuration": 300000 } } ]
Add as many rules as you want to configure for other servers.
-
emoji
is the emoji the bot reacts with after sending theopenText
message. An emoji can be:-
A unicode emoji. https://emojipedia.org is a good reference to copy and paste from.
"😳", "🥺", // etc
-
An emoji ID for custom emojis. You can get a custom emoji's ID by sending
\:YourCustomEmoji:
in chat (prefix a backslash\
character in front of your desired emoji)."716344914706694165", "622635442013208589", // etc
-
-
roleId
is the role assigned to the user after reacting. -
guildId
is the server id. -
channelIds
is the list of channels the bot will randomly choose from when sending theopenText
message. -
maxRoleUsers
is the maximum number of users that are allowed to claim the role. -
openText
is the message the bot sends to poll for user reactions. -
claimCloseText
is the message the bot sends once the number of users that have claimed the role equalsmaxRoleUsers
or when themessageOpen.duration
has elapsed. -
noClaimCloseText
is the message the bot sends if no user has claimed the role andmessageOpen.duration
has elapsed.- You can embed
{users}
and{role}
in any of the text configuration strings when crafting your message.
- You can embed
-
role
durations specify how long the role can be claimed for before the bot unassigns it and polls again. -
messageOpen
durations specify how long the bot will poll for user reactions before closing the message. -
messageClose
durations specify how long the bot will keep the close message up before deleting the message. Exclude this field altogether from the configuration to keep the close message instead of deleting it.role
,messageOpen
,messageClose
requireminDuration
andmaxDuration
in milliseconds.
-
-
npm start
to run the bot.
Visit for more help or information!