Priority Bot is a powerful Discord bot designed to help server admins manage temporary priority roles with ease. Whether you need to grant temporary access to certain channels or manage special roles that expire after a set time, Priority Bot automates the entire process, making your server management more efficient.
- Assign Priority Roles: Easily assign temporary roles to users with slash commands.
- Check Player Status: Quickly check the current priority status and expiration time for any user.
- Automatic Role Removal: Automatically removes roles once the assigned time expires.
- Logging: Logs significant actions and updates to a specified webhook.
- Update Checks: Automatically checks for bot updates and notifies you via webhook.
- Command Locking: Restrict the use of commands to specific roles, enhancing security.
- discord.js: A powerful Node.js module that allows you to interact with the Discord API, enabling rich functionality for managing roles and handling server events.
- pnpm: Recommended for faster and more efficient dependency management.
- connectqueue: For better performance, especially in high-traffic Discord servers, using the
connectqueuesystem is recommended to manage and process tasks in a queue efficiently.
- Node.js v16 or higher
- A Discord bot token
- A Discord server with appropriate roles
pnpminstalled globally (optional, but recommended)
-
Clone the repository:
git clone https://github.com/i6h/priority-bot.git cd priority-bot -
Install dependencies:
If you prefer to use
pnpm, install dependencies with:pnpm install
Alternatively, you can use
npm:npm install
-
Configure the bot:
Rename the
.env.examplefile to.envand add your Discord bot credentials and webhook URL:TOKEN=your_discord_bot_token GUILD_ID=your_guild_id CLIENT_ID=your_discord_client_id WEBHOOK_URL=your_webhook_url
-
Customize the bot:
Open
config.jsand set up your roles and allowed roles:const config = { token: process.env.TOKEN, // dont touch !!! guildId: process.env.GUILD_ID, // dont touch !!! clientId: process.env.CLIENT_ID, // dont touch !!! webhookUrl: process.env.WEBHOOK_URL, //dont touch !!! commandsLocked: false, allowedRoles: ['your_allowed_role_id', 'your_allowed_role_id2'], roles: [ { name: 'Owner', value: 'role_id' }, { name: 'Admins', value: 'role_id' }, { name: 'anything', value: 'role_id' } ] };
-
Optional: Set up the
connectqueuesystem:For better compatibility with various Discord setups, integrate the
connectqueuesystem. Follow the instructions on the connectqueue GitHub page to set it up. -
Run the bot:
pnpm start
Or, if youβre using
npm:npm start
Priority Bot offers several slash commands to manage roles effectively:
Assigns a temporary priority role to a user for a specified duration.
-
Usage:
/givepriority user:@Username priority:<Role> time:<Duration> -
Example:
/givepriority user:@its4lion priority:Gold time:1hThis assigns the "Gold" role to
@its4lionfor 1 hour.
Removes an assigned priority role from a user before its expiration time.
-
Usage:
/removepriority user:@Username -
Example:
/removepriority user:@its4lionThis removes the priority role from
@its4lion.
Lists all users who currently have an assigned priority role, along with the remaining time for each role.
-
Usage:
/list page:<PageNumber> -
Example:
/list page:1This displays the first page of users with assigned priority roles.
Toggles the lock state of the commands. When locked, only users with specific roles can use the botβs commands.
-
Usage:
/togglelockThis toggles the command lock state.
Check the current priority status of a user, including role and remaining time.
-
Usage:
/checkplayer user:@Username -
Example:
/checkplayer user:@its4lionThis checks the current priority status of
@its4lion.
Grant a user temporary access to a special channel by assigning them a "VIP" role for 24 hours:
/givepriority user:@Lion priority:VIP time:24h
The bot automatically removes roles when they expire, so you donβt need to manually track expiration times.
Use the /list command to keep track of who currently has priority roles and when those roles will expire:
/list page:1
Quickly check the current status of any user using the /checkplayer command:
/checkplayer user:@Username
Toggle the command lock with /togglelock to restrict command usage to specific roles (configured in config.js under allowedRoles). This is useful for ensuring that only trusted users can manage roles.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a pull request or open an issue.
If you have any questions, suggestions, or feedback, feel free to reach out:
- Discord User: its4lion.
- GitHub: Open an issue or submit a pull request.
When contacting or opening an issue, please provide as much detail as possible to help us assist you better.