From 88cf977de4e70b0455313dd2cb0cfc1c39a5cdc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wuyi=E6=97=A0=E7=96=91?= <444835641@qq.com> Date: Sun, 22 May 2022 19:57:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- genshinuid.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/genshinuid.py b/genshinuid.py index 48e7b08c..95241dd5 100644 --- a/genshinuid.py +++ b/genshinuid.py @@ -549,11 +549,11 @@ async def open_switch_func(bot: HoshinoBot, ev: CQEvent): if m == '自动签到': try: if at: - if at and at.group(1) != qid: + if qid in bot.config.SUPERUSERS: + qid = at.group(1) + else: await bot.send(ev, '你没有权限。', at_sender=True) return - else: - qid = at.group(1) else: qid = ev.sender['user_id'] gid = ev.group_id @@ -569,11 +569,11 @@ async def open_switch_func(bot: HoshinoBot, ev: CQEvent): elif m == '推送': try: if at: - if at and at.group(1) != qid: + if qid in bot.config.SUPERUSERS: + qid = at.group(1) + else: await bot.send(ev, '你没有权限。', at_sender=True) return - else: - qid = at.group(1) else: qid = ev.sender['user_id'] gid = ev.group_id @@ -617,11 +617,11 @@ async def close_switch_func(bot: HoshinoBot, ev: CQEvent): if m == '自动签到': try: if at: - if at and at.group(1) != qid: + if qid in bot.config.SUPERUSERS: + qid = at.group(1) + else: await bot.send(ev, '你没有权限。', at_sender=True) return - else: - qid = at.group(1) else: qid = ev.sender['user_id'] uid = await select_db(qid, mode='uid') @@ -636,11 +636,11 @@ async def close_switch_func(bot: HoshinoBot, ev: CQEvent): elif m == '推送': try: if at: - if at and at.group(1) != qid: + if qid in bot.config.SUPERUSERS: + qid = at.group(1) + else: await bot.send(ev, '你没有权限。', at_sender=True) return - else: - qid = at.group(1) else: qid = ev.sender['user_id'] uid = await select_db(qid, mode='uid')