Get started with Peachy now 🍑
PEACHYPEACHY
Information

Help

The `help` command displays a list of available bot commands or detailed information about a specific command. It can be triggered using the prefixes `P`, `p`, or the slash command `/`.

Command Details

  • Name: help
  • Aliases: h
  • Category: Info
  • Description: Displays the commands of the bot or detailed information about a specific command.
  • Usage: P help [command], p help [command], or /help [command]
  • Examples:
    • P help
    • p help balance
    • /help avatar
  • Cooldown: 3 seconds
  • Arguments: Optional (command name)
  • Slash Command: Enabled
  • Permissions:
    • Bot: SendMessages, ViewChannel, EmbedLinks
    • User: None
  • Player Requirements: None (no voice, DJ, or active player required)

Functionality

  • If no command is specified, displays a main help menu with categorized command groups (Social & Fun, Economy & Games, Utility & Info) and the total command count.
  • The main menu includes a dropdown to select a category, showing commands paginated (8 per page) with navigation buttons (Previous, Next, Home) and links to the dashboard, support server, and bot invite.
  • When a category is selected, commands are grouped by their first letter for a cleaner display, with a description (truncated to 50 characters if needed).
  • If a command name is provided, shows detailed information about that command, including category, cooldown, aliases, usage, examples, and required permissions, with a "Back to Help" button.
  • Supports both prefix-based (P or p) and slash command (/) inputs.
  • Uses language localization for messages, category names, and emojis.
  • Includes a 5-minute interaction collector for category selection and pagination, disabling non-link buttons after timeout.

Options

The command accepts an optional command option to get detailed information about a specific command:

NameValueDescription
CommandcommandThe command to get detailed info on

Code Overview

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

  • EmbedBuilder to create visually appealing embeds for the main menu and command details.
  • StringSelectMenuBuilder for category selection and ButtonBuilder for pagination and navigation.
  • client.commands to filter and display commands, excluding admin categories.
  • client.utils.formatCapitalize and client.utils.formatTime for formatting.
  • Language localization for messages, category names, and emojis.
  • A collector for handling interactions (category selection, pagination, back button) with a 5-minute timeout.
  • Error handling for invalid command names.