Get started with Peachy now ๐Ÿ‘
PEACHYPEACHY
Fun

Quote

The `quote` command sends a random motivational or general quote in a Discord server. It can be triggered using the slash command `/` or prefix commands.

Command Details

  • Name: quote
  • Aliases: q, ran, quote
  • Category: Fun
  • Description: Displays a random quote (motivational or general).
  • Usage: P quote, p quote, or /quote
  • Examples:
    • P quote
    • p quote
    • /quote
  • Cooldown: 5 seconds
  • Arguments: None
  • Slash Command: Enabled
  • Permissions:
    • Bot: SendMessages, ViewChannel, EmbedLinks
    • User: None
  • Player Requirements: None (no voice, DJ, or active player required)

Functionality

  • Sends an initial "searching" message with a loading emoji for better UX.
  • Selects a random quote from a predefined list of general and motivational quotes (e.g., from Albert Einstein, Walt Disney, Maya Angelou).
  • Displays the quote in an embed with:
    • A formatted title using localized emojis.
    • The quote prefixed with a ๐Ÿ“œ emoji.
    • A footer with the requesterโ€™s display name and avatar.
    • A timestamp.
  • Supports both prefix-based (P or p) and slash command (/) inputs.
  • No user input validation is required, as the command takes no arguments.

Code Overview

The command is built using a Command class structure and handles both message-based and interaction-based inputs. It uses:

  • client.embed() to create a formatted embed for the quote display.
  • A predefined array of quotes, combining general and motivational themes.
  • Language localization for messages and emojis (via language.locales and globalEmoji).
  • Random selection of quotes using Math.random().
  • No external dependencies or database queries, ensuring lightweight execution.