From 29c6abdf292b979e5b70754955ac62d996e43551 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 1 Feb 2022 04:35:28 +0700 Subject: [PATCH] handling command must can be used anywhere --- program/developer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/program/developer.py b/program/developer.py index e9aad80..5c6e61c 100644 --- a/program/developer.py +++ b/program/developer.py @@ -12,7 +12,7 @@ from inspect import getfullargspec from config import BOT_USERNAME as bname from driver.veez import bot -from driver.filters import command, other_filters +from driver.filters import command from pyrogram import Client, filters from driver.decorators import sudo_users_only, errors from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup @@ -31,7 +31,7 @@ async def edit_or_reply(msg: Message, **kwargs): await func(**{k: v for k, v in kwargs.items() if k in spec}) -@Client.on_message(command(["eval", f"eval{bname}"]) & other_filters) +@Client.on_message(command(["eval", f"eval{bname}"]) & & ~filters.edited) @sudo_users_only async def executor(client, message): if len(message.command) < 2: @@ -107,7 +107,7 @@ async def runtime_func_cq(_, cq): await cq.answer(runtime, show_alert=True) -@Client.on_message(command(["sh", f"sh{bname}"]) & other_filters) +@Client.on_message(command(["sh", f"sh{bname}"]) & ~filters.edited) @sudo_users_only async def shellrunner(client, message): if len(message.command) < 2: @@ -170,7 +170,7 @@ async def shellrunner(client, message): await edit_or_reply(message, text="`OUTPUT:`\n`no output`") -@Client.on_message(command(["leavebot", f"leavebot{bname}"]) & other_filters) +@Client.on_message(command(["leavebot", f"leavebot{bname}"]) & ~filters.edited) @sudo_users_only async def bot_leave_group(_, message): if len(message.command) != 2: @@ -185,4 +185,4 @@ async def bot_leave_group(_, message): await message.reply_text(f"āŒ procces failed\n\nreason: `{e}`") print(e) return - await message.reply_text(f"āœ… Bot successfully left from chat: `{chat}`") + await message.reply_text(f"āœ… Bot successfully left from the Group:\n\nĀ» `{chat}`")