A Discord bot that generates QR codes on demand using a slash command — no need to visit a QR code website.
/qrcodeslash command, available in any server the bot is added to- Encode any text or URL into a QR code image
- Optional custom color and size for the generated code
- TypeScript
- discord.js
- qrcode for local QR code generation
- Clone the repo and install dependencies:
npm install - Create a Discord application at the Discord Developer Portal, add a bot to it, and invite it to your server with the
botandapplications.commandsscopes. - Copy
.env.exampleto.envand fill in:DISCORD_TOKEN— from the Bot tabCLIENT_ID— the application ID from General InformationGUILD_ID(optional) — a server ID, for instant command registration during testing instead of waiting on global propagation
- Register the slash command:
npm run deploy-commands - Start the bot:
npm run dev
In any channel the bot can see:
/qrcode text:<text or URL> color:<optional hex color> size:<optional pixel size, 100-1000>