A Telegram bot that generates QR codes.
Users can send any text, and the bot will create a QR code in either PNG or SVG format.
/start
- display the welcome message./help
- show the help message with instructions./settings
- configure the QR code format (PNG or SVG).
Clone the repository:
git clone https://github.com/gicrisf/qrbot.git
cd qrbot
Install dependencies:
npm install
Set up environment variables:
- Create a
.env
file in the root directory. - Add your Telegram bot token:
TELEGRAM_TOKEN=your_telegram_bot_token
Run the bot:
npm start
To run the tests for this bot, ensure you have Bun installed. Once Bun is set up, simply execute the following command in your terminal:
bun test
This will run all the test cases defined in the provided test suite, ensuring the bot’s functionality is working as expected. No additional setup is required beyond having Bun installed.
Build the Docker Image (in the root directory):
docker build -t qrbot .
Run the Docker Container:
docker run -d --name qrbot-container qrbot
Pass the token using the -e
flag:
docker run -d --name qrbot-container -e "TELEGRAM_TOKEN=your_token" qrbot
Your bot should now be running inside the Docker container. To monitor the bot’s logs, use:
docker logs -f qrbot-container
This project is licensed under the MIT License.
- node-telegram-bot-api for the Telegram bot library.
- dotenv for environment variable management.
- Bun for making typescript development so pleasant.