2024-12-31 00:36:08 +04:00
|
|
|
from src.integrations.gigachat_api_client import GigaChatClient
|
2024-12-31 00:28:00 +04:00
|
|
|
from src.bot.telegram_userbot import TelegramUserBot
|
2025-01-04 16:31:40 +04:00
|
|
|
from src.utils import logging
|
2024-12-31 00:28:00 +04:00
|
|
|
from src.core.configuration import config
|
|
|
|
|
|
|
|
|
|
|
|
def main() -> None:
|
|
|
|
"""
|
|
|
|
Entry point for starting the Telegram user bot.
|
|
|
|
"""
|
2025-01-02 05:54:43 +04:00
|
|
|
# Configure logging
|
2025-01-04 16:31:40 +04:00
|
|
|
logging.setup_logging()
|
2025-01-02 05:54:43 +04:00
|
|
|
|
2024-12-31 00:28:00 +04:00
|
|
|
# Load API credentials and configuration
|
2024-12-31 00:36:08 +04:00
|
|
|
api_id: str = config.API_ID
|
|
|
|
api_hash: str = config.API_HASH
|
|
|
|
api_token: str = config.API_GIGACHAT_TOKEN
|
2024-12-31 00:28:00 +04:00
|
|
|
|
2024-12-31 00:36:08 +04:00
|
|
|
# Initialize GigaChatClient
|
|
|
|
gigachat_client: GigaChatClient = GigaChatClient(api_token=api_token)
|
2024-12-31 00:28:00 +04:00
|
|
|
|
|
|
|
# Initialize and run the Telegram user bot
|
2024-12-31 00:36:08 +04:00
|
|
|
bot: TelegramUserBot = TelegramUserBot(
|
2024-12-31 00:28:00 +04:00
|
|
|
session_name="userbot",
|
|
|
|
api_id=api_id,
|
|
|
|
api_hash=api_hash,
|
2024-12-31 00:36:08 +04:00
|
|
|
gigachat_client=gigachat_client
|
2024-12-31 00:28:00 +04:00
|
|
|
)
|
|
|
|
bot.run()
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|
|
|
|
|