From 8895639f209691454315878213e28b6ca9b04327 Mon Sep 17 00:00:00 2001 From: Andrey Kondratev <81143241+cockroach-eater@users.noreply.github.com> Date: Fri, 29 Aug 2025 10:10:09 +0500 Subject: [PATCH] bot --- src/server.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/server.ts b/src/server.ts index 52c9f5c..1b4d11d 100644 --- a/src/server.ts +++ b/src/server.ts @@ -8,6 +8,7 @@ ffmpeg.setFfmpegPath('/usr/bin/ffmpeg'); ffmpeg.setFfprobePath('/usr/bin/ffprobe'); import { Database } from './database'; import { SoundCloudService } from './soundcloud'; +import { QuixoticBot } from './bot'; const app = express(); const port = process.env.PORT || 3000; @@ -233,4 +234,15 @@ app.listen(port, () => { console.log(`Open in browser: http://localhost:${port}`); }); +// Initialize Telegram bot +const botToken = process.env.TELEGRAM_BOT_TOKEN; +const webAppUrl = process.env.WEB_APP_URL || `http://localhost:${port}`; + +if (botToken) { + const bot = new QuixoticBot(botToken, webAppUrl); + console.log('🤖 Telegram bot started'); +} else { + console.warn('⚠️ TELEGRAM_BOT_TOKEN not found - bot will not start'); +} + export default app; \ No newline at end of file