This is a Discord bot that generate QR Codes from messages. When a user sends a message starting with !
, the bot will generate a QR code from the message and send it back as an image. The message can be texts, URLs etc.
- Clone the repository:
git clone https://github.com/nilaysarma/QR-Code-Discord-Bot.git
- Install the required packages:
pip install -r requirements.txt
- Open the
.env
file and replaceYOUR_BOT_TOKEN_HERE
with your discord bot token.
DISCORD_TOKEN=YOUR_BOT_TOKEN_HERE
- To run the bot, execute the following command:
- On Windows:
python main.py
- On Linux / MacOS
python3 main.py
-
Start your message with
!
followed by the text/URL you want to convert to a QR code. -
The bot will respond with a QR code image.
Here is an example below:
discord.py
: Python wrapper for the Discord API.python-dotenv
: Reads key-value pairs from a.env
file and can set them as environment variables.qrcode[pil]
: A pure Python QR Code generator with PIL (Python Imaging Library) support.