From 328558d754ee4d7ea6e201a7e24c42d27554a008 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Thu, 24 Feb 2022 11:56:39 +0700 Subject: [PATCH] [check] some changes --- program/assistant_settings.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/program/assistant_settings.py b/program/assistant_settings.py index 5ce04ef..cc5d32b 100644 --- a/program/assistant_settings.py +++ b/program/assistant_settings.py @@ -23,6 +23,7 @@ from config import BOT_USERNAME, SUDO_USERS from program.utils.function import get_calls +from driver.queues import QUEUE from driver.core import user, me_bot from driver.filters import command, other_filters from driver.database.dbchat import remove_served_chat @@ -161,6 +162,11 @@ async def bot_kicked(c: Client, m: Message): chat_id = m.chat.id left_member = m.left_chat_member if left_member.id == bot_id: - await user.leave_chat(chat_id) - await remove_served_chat(chat_id) - await remove_active_chat(chat_id) + if chat_id in QUEUE: + await remove_active_chat(chat_id) + return + try: + await user.leave_chat(chat_id) + await remove_served_chat(chat_id) + except BaseException as err: + print(err)