[check] some changes

This commit is contained in:
levina 2022-02-24 11:56:39 +07:00 committed by GitHub
parent c8a62b402e
commit 328558d754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,7 @@ from config import BOT_USERNAME, SUDO_USERS
from program.utils.function import get_calls from program.utils.function import get_calls
from driver.queues import QUEUE
from driver.core import user, me_bot from driver.core import user, me_bot
from driver.filters import command, other_filters from driver.filters import command, other_filters
from driver.database.dbchat import remove_served_chat 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 chat_id = m.chat.id
left_member = m.left_chat_member left_member = m.left_chat_member
if left_member.id == bot_id: if left_member.id == bot_id:
if chat_id in QUEUE:
await remove_active_chat(chat_id)
return
try:
await user.leave_chat(chat_id) await user.leave_chat(chat_id)
await remove_served_chat(chat_id) await remove_served_chat(chat_id)
await remove_active_chat(chat_id) except BaseException as err:
print(err)