This commit is contained in:
2026-01-28 11:30:30 +03:00
commit 641b88138d
18 changed files with 1655 additions and 0 deletions

30
bot.py Normal file
View File

@ -0,0 +1,30 @@
"""Main bot module."""
import telebot
from config import Config
from database import init_db
from handlers.group_handlers import register_group_handlers
from handlers.private_handlers import register_private_handlers
from handlers.command_handlers import register_command_handlers
def create_bot() -> telebot.TeleBot:
"""Create and configure the bot."""
# Validate configuration
Config.validate()
# Ensure BOT_TOKEN is not None
if not Config.BOT_TOKEN:
raise ValueError("BOT_TOKEN is required")
# Initialize database
init_db()
# Create bot instance
bot = telebot.TeleBot(Config.BOT_TOKEN)
# Register all handlers
register_group_handlers(bot)
register_private_handlers(bot)
register_command_handlers(bot)
return bot