CoolFace
Apppublic

RetroBoo/GusliSenseya

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
bot_instance.py18 linesDownload Raw Back to root
1import os2import socket3from aiogram import Bot4from aiogram.client.session.aiohttp import AiohttpSession5 6class IPv4Session(AiohttpSession):7    def __init__(self, **kwargs):8        super().__init__(**kwargs)9        # Instruct the built-in aiohttp connector to strictly use IPv410        self._connector_init["family"] = socket.AF_INET11 12# Initialize the lazy session13session = IPv4Session()14 15# Fetch the token and create the global bot16BOT_TOKEN = os.getenv("BOT_TOKEN")17bot = Bot(token=BOT_TOKEN, session=session)18