Commands
QR Code
Documentation for the /qrcode command to generate and decode QR codes
/qrcode
Command
The /qrcode
command provides tools to generate and decode QR codes.
Available Subcommands
/qrcode generate
- Generate a QR code from text or URL/qrcode decode
- Decode a QR code from an image
Usage
Generate QR Code
Options
Option | Description | Required | Platform |
---|---|---|---|
content | The text or URL to encode in the QR code | Yes | Discord (parameter), Slack (flag with —content) |
size | The size of the QR code in pixels (128-1024) | No (default: 256) | Discord (parameter), Slack (flag with —size) |
Example
This command will generate a 512x512 pixel QR code containing the URL “https://google.fr” as shown below:
Decode QR Code
Options
Option | Description | Required | Platform |
---|---|---|---|
image | The image containing the QR code to decode | Yes | Discord only |
url | URL to an image containing a QR code to decode | Yes | Slack only |
For Discord, attach an image containing a QR code, and the command will return the encoded text or URL.
For Slack, provide a URL to a publicly accessible image containing a QR code.
If the decoded content is a URL, it will be identified as such.
Platform-Specific Implementation
Discord Implementation
- Uses Discord’s named parameter system (e.g.,
content:
,size:
) - For decode, uses Discord’s file attachment system
- Response appears as an embedded message with the QR code as an attachment
- For decode, users directly attach images to the command
Slack Implementation
- Uses Slack’s flag-based approach with
--flag value
syntax - For generate, outputs the QR code as an image file in the channel
- For decode, requires a URL to a publicly accessible image (due to Slack API limitations)
- Response appears as a formatted message with blocks in Slack
Example Use Cases
Example 1: Generate a QR code for a website
Example 2: Generate a QR code for text
Example 3: Generate a QR code with custom size
Example 4: Decode a QR code
Features
- Quickly generate QR codes from any text or URL
- Decode QR codes from images
- Customize the size of generated QR codes
- Automatic URL detection in decoded content
Notes
- Larger QR codes are easier to scan but take up more space
- For optimal scanning, ensure the QR code has good contrast and is not distorted
- QR codes can contain text, URLs, contact information, and more
- For Slack decode, the image URL must be publicly accessible
Limitations
-
Minimum size: 128 pixels
-
Maximum size: 1024 pixels
-
Content cannot be empty
-
In Slack, decode requires a URL rather than a direct file upload due to API limitations