Get started with Peachy now 🍑
PEACHYPEACHY
Work

Resign Job

The resignjob command allows users to resign from their current job position and reset their job status.

Command Details

  • Name: resignjob
  • Aliases: resign, jobresign
  • Category: Work
  • Description: Resign from your current job position.
  • Usage:
    • resignjob
  • Examples:
    • resignjob - Removes your current job and resets status.
  • Cooldown: 10 seconds
  • Arguments: None
  • Slash Command: Enabled
  • Permissions:
    • Bot: SendMessages, ViewChannel, EmbedLinks
    • User: None
  • Player Requirements: User must have an active job to resign.

Functionality

  • Fetches the user record from the Users schema.
  • Validation:
    • If user not found → Returns an error.
    • If user has status = not applied → Sends an error saying there is no job to resign.
  • On success:
    • Resets job details:
      • work.position"Not yet applied"
      • work.status"not applied"
      • work.applyDatenull
      • work.approvedDatenull
    • Saves changes to the database.
  • Responds with an embed:
    • Title: RESIGN JOB
    • Message confirming resignation.
    • Requested by footer with username and avatar.

Code Overview

The command:

  • Extends the Command class from ../../structures/index.js.
  • Uses language.locales for localized messages.
  • Updates user job data in the database.
  • Uses client.utils for:
    • Error handling
    • Emojis
    • Embed building
  • Handles errors with a fallback internal error message.

Example Embed (Success)