From 30da7b208c222ae6a35d1b236db99a8fc7b2bec2 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 26 Jan 2022 21:08:10 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20sb:=20simplify=20execute=20process?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagermaid/modules/sb.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pagermaid/modules/sb.py b/pagermaid/modules/sb.py index 1568a0c..b58f848 100644 --- a/pagermaid/modules/sb.py +++ b/pagermaid/modules/sb.py @@ -1,4 +1,4 @@ -from pagermaid import log, redis, redis_status +from pagermaid import log, redis, redis_status, user_id as self_user_id from pagermaid.listener import listener from pagermaid.utils import lang, alias_command from struct import error as StructError @@ -34,7 +34,8 @@ def mention_group(chat): return text -@listener(is_plugin=False, outgoing=True, command=alias_command("sb"), +@listener(is_plugin=False, outgoing=True, + command=alias_command("sb"), description=lang('sb_des'), parameters=" ") async def span_ban(context): @@ -109,8 +110,6 @@ async def span_ban(context): pass except ChatAdminRequiredError: pass - myself = await context.client.get_me() - self_user_id = myself.id if target_user.user.id == self_user_id: await context.edit(lang('arg_error')) return