refactoring

This commit is contained in:
Artyom Ashirov
2024-11-23 05:03:30 +03:00
parent dcc678a42b
commit 5d4f56e265
22 changed files with 1109 additions and 1014 deletions

17
src/context/bot.js Normal file
View File

@@ -0,0 +1,17 @@
import TelegramBot from "node-telegram-bot-api";
import config from "../config/config.js";
const initBot = () => {
try {
const bot = new TelegramBot(config.BOT_TOKEN, {polling: true});
console.log('Bot initialized successfully');
return bot;
} catch (error) {
console.error('Failed to initialize bot:', error);
process.exit(1);
}
};
const bot = initBot();
export default bot;

View File

@@ -0,0 +1,2 @@
const userStates = new Map();
export default userStates;