Company
Check User Apply
The `checkuserapply` command lists all users who have applied for a job, including their job position and application status.
Command Details
- Name: checkuserapply
- Aliases: checkapply, ca
- Category: Company
- Description: List all users who have applied for a job.
- Usage:
checkuserapply
- Examples:
checkuserapply
- Cooldown: 3 seconds
- Arguments: None
- Slash Command: Disabled
- Permissions:
- Bot: SendMessages, ViewChannel, EmbedLinks
- User: Developer or Staff only
- Player Requirements: None
Functionality
- Retrieves users from the database whose
work.status
is either:pending
approved
- If no users are found:
- Sends an error message:
"No users have applied for a job yet."
- Sends an error message:
- Prepares a formatted list for each user:
- Username
- Discord ID
- Job Position
- Status
- Splits the list into pages of 10 users per embed using
client.utils.chunk()
. - Displays pages with reaction-based pagination via
client.utils.reactionPaginate()
.
Code Overview
- Extends the
Command
class. - Imports:
Users
schema from../../schemas/user
.
- Uses:
Users.find({ "work.status": { $in: ["pending", "approved"] } });