From a4826c67c7d80c24cdc3ea30b2c20f39deacc895 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Thu, 10 Feb 2022 11:16:41 +0700 Subject: [PATCH] function some fixes --- program/userbot_tools.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/program/userbot_tools.py b/program/userbot_tools.py index 2a7ba41..0f0a438 100644 --- a/program/userbot_tools.py +++ b/program/userbot_tools.py @@ -6,7 +6,7 @@ from config import BOT_USERNAME, SUDO_USERS from driver.filters import command, other_filters from driver.database.dbchat import remove_served_chat from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant -from driver.decorators import authorized_users_only, sudo_users_only +from driver.decorators import authorized_users_only, bot_creator @Client.on_message( @@ -47,7 +47,7 @@ async def leave_chat(_, m: Message): @Client.on_message(command(["leaveall", f"leaveall@{BOT_USERNAME}"])) -@sudo_users_only +@bot_creator async def leave_all(client, message): if message.from_user.id not in SUDO_USERS: return @@ -82,5 +82,4 @@ async def bot_kicked(c: Client, m: Message): left_member = m.left_chat_member if left_member.id == bot_id: await user.leave_chat(chat_id) - return - await remove_served_chat(chat_id) + await remove_served_chat(chat_id)