feat: Add Telegram bot with group support

- Full Telegram bot implementation for Lightning Jackpot
- Commands: /start, /buy, /tickets, /wins, /address, /jackpot, /help
- Lightning invoice generation with QR codes
- Payment polling and confirmation notifications
- User state management (Redis/in-memory fallback)
- Group support with admin settings panel
- Configurable draw announcements and reminders
- Centralized messages for easy i18n
- Docker configuration included
This commit is contained in:
Michilis
2025-11-27 23:10:25 +00:00
parent d3bf8080b6
commit f743a6749c
29 changed files with 7616 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
import QRCode from 'qrcode';
import { logger } from './logger';
/**
* Generate a QR code as a buffer from a Lightning invoice
*/
export async function generateQRCode(data: string): Promise<Buffer> {
try {
const buffer = await QRCode.toBuffer(data.toUpperCase(), {
errorCorrectionLevel: 'M',
type: 'png',
margin: 2,
width: 300,
color: {
dark: '#000000',
light: '#FFFFFF',
},
});
return buffer;
} catch (error) {
logger.error('Failed to generate QR code', { error });
throw error;
}
}
export default { generateQRCode };