bot
This commit is contained in:
@@ -8,6 +8,7 @@ ffmpeg.setFfmpegPath('/usr/bin/ffmpeg');
|
|||||||
ffmpeg.setFfprobePath('/usr/bin/ffprobe');
|
ffmpeg.setFfprobePath('/usr/bin/ffprobe');
|
||||||
import { Database } from './database';
|
import { Database } from './database';
|
||||||
import { SoundCloudService } from './soundcloud';
|
import { SoundCloudService } from './soundcloud';
|
||||||
|
import { QuixoticBot } from './bot';
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = process.env.PORT || 3000;
|
const port = process.env.PORT || 3000;
|
||||||
@@ -233,4 +234,15 @@ app.listen(port, () => {
|
|||||||
console.log(`Open in browser: http://localhost:${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;
|
export default app;
|
||||||
Reference in New Issue
Block a user