import asyncio
import os

from sspart_py_lib import TelegramClient

async def main() -> None:
    token = "5482825380:AAF6Zoiw8prarMLLVZcLKnQmQA-6sXLkFyQ"
    chat_id = "5356679602"

    if not token:
        print("Set TELEGRAM_BOT_TOKEN first.")
        return

    client = TelegramClient(token=token)
    bot_info = await client.get_me()
    print("Telegram bot authenticated as:", bot_info.username)

    if chat_id:
        response = await client.send_text(chat_id=chat_id, text="Hello from sspart-py-lib")
        print("Message sent. Message ID:", response.message_id)
    else:
        print("Set TELEGRAM_CHAT_ID to also send a test message.")


if __name__ == "__main__":
    asyncio.run(main())
