Work
Position
The position command allows users to check their current work position and application status in the game.
Command Details
- Name: position
- Aliases: jobinfo, checkposition
- Category: Work
- Description: Check your current work position.
- Usage:
position
- Examples:
position
- Shows your job status.
- Cooldown: 5 seconds
- Arguments: None
- Slash Command: Enabled
- Permissions:
- Bot: SendMessages, ViewChannel, EmbedLinks
- User: None
- Player Requirements: User must be registered to check their position.
Functionality
- Fetches the user from the
Users
schema byuserId
. - Validation:
- If user not found → Sends an error message.
- Behavior based on job status:
- If position exists and status = awaiting → Displays an embed showing the user is currently applying for a job.
- If position does not exist or status is not approved → Displays an error message indicating no job assigned.
- If status = approved → Displays the user's current job position.
- For IT job → Capitalizes as IT for display.
- Responds with an embed that includes:
- Job position
- Status message
- Requested by footer
- Emoji thumbnail for position
Code Overview
The command:
- Extends the
Command
class from../../structures/index.js
. - Uses
language.locales
for localized messages. - Checks
user.work.position
anduser.work.status
. - Constructs an embed:
- When applying: Shows message like
"You are applying for Position"
. - When approved: Shows message like
"You are currently working as Position"
.
- When applying: Shows message like
- Handles errors and sends a generic internal error message if needed.
Example Embed (Applying)
Police
The police command allows players with the Police job to catch thieves who have successfully robbed another user. It includes success and failure outcomes with rewards and penalties.
Resign Job
The resignjob command allows users to resign from their current job position and reset their job status.