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