I can't understand what the problem is and how to solve it. The bot itself works fine, but when I stop it, I get the error RuntimeError: Session is closed in the log
import logging
from interactions import Activity, ActivityType, Client, Intents, Status
class Bot(Client):
def __init__(self, token: str) -> None:
super().__init__(
activity=Activity(
type=ActivityType.COMPETING,
name='Valorant❤️',
),
status=Status.DO_NOT_DISTURB,
intents=Intents.ALL,
disable_dm_commands=True,
logging_level=logging.INFO,
basic_logging=True,
token=token,
)
async def bot_launch(self) -> None:
await self.astart()
import asyncio
import logging
from sys import stdout
from src.common import EXTENSIONS, env
from src.core import Bot
from src.utils import setup_extensions
async def main() -> None:
bot = Bot(env.bot.token.get_secret_value())
setup_extensions(bot, EXTENSIONS)
await bot.bot_launch()
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO, stream=stdout)
try:
asyncio.run(main())
except (KeyboardInterrupt, SystemExit):
logging.error('Bot stopped!')