python_study-project/main.py
2025-01-02 05:54:43 +04:00

33 lines
886 B
Python

from src.integrations.gigachat_api_client import GigaChatClient
from src.bot.telegram_userbot import TelegramUserBot
from src.utils.logging import setup_logging
from src.core.configuration import config
def main() -> None:
"""
Entry point for starting the Telegram user bot.
"""
# Configure logging
setup_logging()
# Load API credentials and configuration
api_id: str = config.API_ID
api_hash: str = config.API_HASH
api_token: str = config.API_GIGACHAT_TOKEN
# Initialize GigaChatClient
gigachat_client: GigaChatClient = GigaChatClient(api_token=api_token)
# Initialize and run the Telegram user bot
bot: TelegramUserBot = TelegramUserBot(
session_name="userbot",
api_id=api_id,
api_hash=api_hash,
gigachat_client=gigachat_client
)
bot.run()
if __name__ == "__main__":
main()