Telegram Shop Bot
A feature-rich Telegram bot for managing a shop with invoice generation, payment processing, and user management capabilities. Built with Node.js and MySQL.
Features
Multi-language Support
Supports both English and Persian languages
Users can select their preferred language
All messages and notifications are available in both languages
User Management
QR code-based user registration system
Admin can generate unique invitation links and QR codes
Secure user registration with phone number verification
User information storage in MySQL database
Language preference tracking
Invoice Management
Admin can create invoices for users
Support for multiple payment gateways
Real-time payment status tracking
Automatic payment verification
Transaction history logging
Payment Processing
Integration with Zarinpal payment gateway
Extensible payment gateway architecture
Secure payment verification
Automatic status updates
Payment callback handling
Admin Features
Generate invitation QR codes and links
Create and manage invoices
Monitor payment status
Receive payment notifications
View transaction history
Security
Phone number verification
Secure payment processing
Admin-only protected commands
Data validation and sanitization
Technical Stack
Backend : Node.js
Database : MySQL 8.0
Container : Docker & Docker Compose
Dependencies :
node-telegram-bot-api
Sequelize ORM
QRCode generator
Iranian Zarinpal payment gateway
Repository on github
https://github.com/No-platforms/telegram-bot-invoice
Bot commands
User Commands
/start - Start the bot and register
/language - Change language preference
/help - Show help message
/pay - View pending invoices
Admin Commands
/invite - Generate new invitation QR code and link
/createinvoice <amount> <description> - Create new invoice
/stats - View bot statistics
/broadcast - Send message to all users
Database Schema
Users Table
User information
Registration status
Language preference
Invitation tracking
Invoices Table
Invoice details
Payment status
Transaction references
Transactions Table
Payment records
Gateway information
Transaction status
Development
Adding Payment Gateways
Create new gateway class in src/payment/gateways/
Implement required methods
Register in PaymentService
Run docker image
docker run \
-e DB_HOST=db \
-e DB_USER=${DB_USER} \
-e DB_PASS=${DB_PASS} \
-e DB_NAME=${DB_NAME} \
-e BOT_TOKEN=${TELEGRAM_BOT_TOKEN} \
-e ADMIN_USER_ID=${ADMIN_USER_ID} \
-e BOT_USERNAME=${BOT_USERNAME} \
-e ZARINPAL_MERCHANT_ID=${ZARINPAL_MERCHANT_ID} \
-e BASE_URL=${BASE_URL} \
telegram-shop-bot
Copy
Contributing
Fork the repository
Create feature branch
Commit changes
Push to branch
Create Pull Request
License
MIT License - feel free to use and modify for your own projects.
Support
For support and questions, please open an issue in the GitHub repository.