From 84089c32415cc40bc963fee2ad2cf94ae49b26df Mon Sep 17 00:00:00 2001 From: yasirarism <55983182+yasirarism@users.noreply.github.com> Date: Tue, 16 May 2023 06:49:59 +0000 Subject: [PATCH] Fix when session is None --- README.md | 4 ++-- misskaty/__init__.py | 2 ++ misskaty/__main__.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 862615ba..ec8bc3d3 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ python3 --version ``` apt update -y & apt install libjpeg-dev zlib1g-dev libwebp-dev python3-pip python3-lxml git wget curl ffmpeg locales tzdata neofetch mediainfo speedtest-cli -y ``` -- Install requirements.txt, if using python 3.11, you need pass `--break-system-packages` parameter. +- Install requirements.txt, if using python 3.11, you need pass `--break-system-packages` parameter or use venv when install.
*Python < 3.10* ``` pip3 install -r requirements.txt @@ -89,7 +89,7 @@ pip3 install -r requirements.txt ``` pip3 install -r requirements.txt --break-system-packages ``` -- Setting your config.env or via environment. Make sure you fill all required env/ +- Setting your config.env or via environment. Make sure you fill all required env. - Run Bot ``` bash start.sh diff --git a/misskaty/__init__.py b/misskaty/__init__.py index e11b553e..5b14e808 100644 --- a/misskaty/__init__.py +++ b/misskaty/__init__.py @@ -56,6 +56,8 @@ if USER_SESSION: UBOT_ID = user.me.id UBOT_NAME = user.me.first_name UBOT_USERNAME = user.me.username +else: + None, None, None = UBOT_ID, UBOT_NAME, UBOT_USERNAME BOT_ID = app.me.id BOT_NAME = app.me.first_name BOT_USERNAME = app.me.username diff --git a/misskaty/__main__.py b/misskaty/__main__.py index f47e422b..1b49682b 100644 --- a/misskaty/__main__.py +++ b/misskaty/__main__.py @@ -67,7 +67,7 @@ async def start_bot(): else: await app.send_message( i, - f"BOT STARTED with Pyrogram v{__version__}..\nBot: {BOT_NAME}\n\nwith Pyrogram v{__version__} (Layer {layer}) started on @{BOT_USERNAME}.\n\n{bot_modules}", + f"BOT STARTED with Pyrogram v{__version__} as {BOT_NAME}\n\nwith Pyrogram v{__version__} (Layer {layer}) started on @{BOT_USERNAME}.\n\n{bot_modules}", ) except Exception as e: LOGGER.error(str(e))