QR Code
The `qr` command displays a QR code for KHR or USD in a Discord server. It can be triggered using the prefixes `P`, `p`, or the slash command `/`.
QR Code Command
The qr
command is a utility feature in a Discord bot that displays a QR code for a specified currency (KHR or USD).
Command Details
- Name:
qr
- Aliases:
qrcode
- Category: Utility
- Description: Displays the QR code for KHR or USD.
- Usage:
- Prefix:
P qr <kh|usd>
,p qr <kh|usd>
- Slash:
/qr [currency]
- Prefix:
- Examples:
P qr kh
p qr usd
/qr kh
- Cooldown: 3 seconds
- Arguments: Required (currency: kh or usd)
- Slash Command: Enabled
- Permissions:
- Bot: SendMessages
- User: SendMessages
- Player Requirements: None (no voice, DJ, or active player required)
Functionality
- Displays a QR code image for the specified currency (KHR or USD).
- Sends an initial "searching" message with a loading emoji, then replaces it with an embed containing:
- The QR code image for the selected currency, sourced from
globalGif.qrKH
orglobalGif.qrUSD
. - A title indicating the currency (e.g., "QR Code for KHR").
- A description confirming the QR code for the selected currency.
- The QR code image for the selected currency, sourced from
- Supports both prefix-based (
P
orp
) and slash command (/
) inputs. - If an invalid currency is provided (not
kh
orusd
), an error message is displayed, optionally with an ephemeral flag for slash commands.
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.globalGif.qrKH
orglobalGif.qrUSD
to retrieve the QR code image URL based on the selected currency.- Language localization for messages and emojis via
qrMessages
. - Error handling for invalid currency inputs (not
kh
orusd
).
Language
The `language` command allows users to manage their language settings or view their current language in a Discord server. It can be triggered using the prefixes `P`, `p`, or the slash command `/`.
Quote
The `quote` command sends a random motivational or general quote in a Discord server. It can be triggered using the prefixes `P`, `p`, or the slash command `/`.