Get started with Peachy now 🍑
PEACHYPEACHY
Utility

Banner

The `banner` command allows users to display a user's banner in a Discord server. It can be triggered using the prefixes `P`, `p`, or the slash command `/`.

Banner Command

The banner command is a utility feature in a Discord bot that displays a user's banner.

Command Details

  • Name: banner
  • Aliases: profilebanner, pfp-banner
  • Category: Utility
  • Description: Displays a user's banner.
  • Usage:
    • Prefix: P banner [@User], p banner [@User]
    • Slash: /banner [user]
  • Examples:
    • P banner @User
    • p banner @User
    • /banner @User
  • Cooldown: 3 seconds
  • Arguments: Optional (user mention or ID)
  • Slash Command: Enabled
  • Permissions:
    • Bot: SendMessages, ViewChannel, EmbedLinks
    • User: None
  • Player Requirements: None (no voice, DJ, or active player required)

Functionality

  • If no user is mentioned, the command defaults to showing the banner of the user who invoked it.
  • The command sends an initial "searching" message with a loading emoji, then replaces it with an embed containing:
    • The user's banner image (1024x1024, dynamic format).
    • A title with customizable emojis.
    • A footer showing the requester's display name and avatar.
    • A timestamp.
  • Supports both prefix-based (P or p) and slash command (/) inputs.
  • If no valid user is found or the user has no banner, an error message is displayed.

Code Overview

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

  • client.embed() to create a formatted embed.
  • mention.fetch().then(user => user.bannerURL()) to fetch the user's banner.
  • Language localization for messages and emojis.
  • Error handling for cases where no user is mentioned or no banner is found.