Information
Rules
The `rules` command displays the rules for using the bot in a Discord server. It can be triggered using the prefixes `P`, `p`, or the slash command `/`.
Command Details
- Name: rules
- Aliases: guidelines
- Category: Information
- Description: Displays the rules for using the bot
- Usage:
P rules
,p rules
, or/rules
- Examples:
P rules
p rules
/rules
- Cooldown: 3 seconds
- Arguments: None
- Slash Command: Enabled
- Permissions:
- Bot: SendMessages, ViewChannel, EmbedLinks
- User: None
- Player Requirements: None (no voice, DJ, or active player required)
Functionality
- Displays the bot's usage rules and guidelines in a comprehensive embed format.
- Shows an embed with:
- A title and description explaining the rules overview.
- A banner image from the global GIF collection (
globalGif.banner.rule
). - Dynamic fields containing individual rules and guidelines.
- Each rule section includes detailed explanations and expectations.
- A footer with the bot's display name and avatar.
- Timestamp of when the command was executed.
- Includes interactive buttons:
- Support button linking to the support server.
- Invite button for adding the bot to other servers.
- Supports both prefix-based (
P
orp
) and slash command (/
) inputs. - Handles errors with appropriate error messages.
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 with rules information.globalGif.banner.rule
to display a visual banner image for the rules.- Dynamic field addition using
forEach()
to iterate through rules sections. client.utils.linkButton
to create interactive buttons for support and invite links.client.utils.createButtonRow
to organize buttons in a row layout.- Language localization for messages and rules content (
rulesMessages.rules
). - Configuration links for support and invite functionality.
- Bot display name integration for personalized footer information.
- Timestamp and visual elements for better user experience.
- Error handling for unexpected issues during execution.
Privacy Policy
The `privacy` command displays the bot's privacy policy in a Discord server. It can be triggered using the prefixes `P`, `p`, or the slash command `/`.
Stats
The `stats` command displays comprehensive statistics about the bot in a Discord server. It can be triggered using the prefixes `P`, `p`, or the slash command `/`.