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:
26
telegram_bot/src/handlers/help.ts
Normal file
26
telegram_bot/src/handlers/help.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import TelegramBot from 'node-telegram-bot-api';
|
||||
import { logUserAction } from '../services/logger';
|
||||
import { getMainMenuKeyboard } from '../utils/keyboards';
|
||||
import { messages } from '../messages';
|
||||
|
||||
/**
|
||||
* Handle /help command
|
||||
*/
|
||||
export async function handleHelpCommand(
|
||||
bot: TelegramBot,
|
||||
msg: TelegramBot.Message
|
||||
): Promise<void> {
|
||||
const chatId = msg.chat.id;
|
||||
const userId = msg.from?.id;
|
||||
|
||||
if (userId) {
|
||||
logUserAction(userId, 'Viewed help');
|
||||
}
|
||||
|
||||
await bot.sendMessage(chatId, messages.help.message, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_markup: getMainMenuKeyboard(),
|
||||
});
|
||||
}
|
||||
|
||||
export default handleHelpCommand;
|
||||
Reference in New Issue
Block a user