A Discord bot that automatically assigns or removes a role based on whether a user has a specific tag in their profile. It also supports manual checks with cooldowns to prevent spam.
- Periodically checks all guild members for a specific tag.
- Assigns a role if the member has the tag and doesn't already have the role.
- Removes the role if the member no longer has the tag but still has the role.
- Logs role changes in a designated log channel with embedded messages.
- Manual user check with a command
!check
with a 30-minute cooldown. - Rate limiting included to avoid hitting Discord API rate limits.
- Node.js v16 or higher
- discord.js v14
Update the following constants in the source code:
TOKEN
: Your Discord bot token.TAG
: The tag to check for (e.g.,'DTX'
).ROLE_ID
: The ID of the role to assign/remove.GUILD_ID
: The ID of your Discord server.LOG_CHANNEL_ID
: The ID of the channel where logs will be sent.
- Clone the repository or copy the code.
- Run
npm install discord.js
. - Replace the configuration constants with your own.
- Run the bot with
node senotron.js
(or your filename).
- The bot will automatically check members every 10 minutes.
- Users can manually check their tag and role status by sending
!check
. - If a user tries to run
!check
within 30 minutes of their last use, they will receive a cooldown message.
This project is open source and free to use.