sb: simplify execute process

This commit is contained in:
Sam 2022-01-26 21:08:10 +08:00
parent 0d0602042a
commit 30da7b208c
Signed by: sam01101
GPG Key ID: 42D7B6D13FF5E611

View File

@ -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.listener import listener
from pagermaid.utils import lang, alias_command from pagermaid.utils import lang, alias_command
from struct import error as StructError from struct import error as StructError
@ -34,7 +34,8 @@ def mention_group(chat):
return text 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'), description=lang('sb_des'),
parameters="<reply|id|username> <do_not_del_all>") parameters="<reply|id|username> <do_not_del_all>")
async def span_ban(context): async def span_ban(context):
@ -109,8 +110,6 @@ async def span_ban(context):
pass pass
except ChatAdminRequiredError: except ChatAdminRequiredError:
pass pass
myself = await context.client.get_me()
self_user_id = myself.id
if target_user.user.id == self_user_id: if target_user.user.id == self_user_id:
await context.edit(lang('arg_error')) await context.edit(lang('arg_error'))
return return