From 77fc4d33584c3cdb35eeaa679d5a62b7a8b4a85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Wed, 31 Aug 2022 15:55:48 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E6=8F=92=E4=BB=B6=E5=9C=A8=E8=8E=B7=E5=8F=96=20job=20?= =?UTF-8?q?=E6=97=B6=E8=BF=94=E5=9B=9E=20`None`=20=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `kick_member_job` 日记等级修改为 `info` --- plugins/system/auth.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/system/auth.py b/plugins/system/auth.py index d7f54f82..65377a01 100644 --- a/plugins/system/auth.py +++ b/plugins/system/auth.py @@ -62,7 +62,7 @@ class GroupJoiningVerification: async def kick_member_job(self, context: CallbackContext): job = context.job - Log.debug(f"踢出用户 user_id[{job.user_id}] 在 chat_id[{job.chat_id}]") + Log.info(f"踢出用户 user_id[{job.user_id}] 在 chat_id[{job.chat_id}]") try: await context.bot.ban_chat_member(chat_id=job.chat_id, user_id=job.user_id, until_date=int(time.time()) + self.kick_time) @@ -124,7 +124,7 @@ class GroupJoiningVerification: if result == "pass": await callback_query.answer(text="放行", show_alert=False) await self.restore_member(context, chat.id, user_id) - if schedule := context.job_queue.scheduler.get_job(f"{chat.id}|{user_id}|clean_join"): + if schedule := context.job_queue.scheduler.get_job(f"{chat.id}|{user_id}|auth_clean_join_message"): schedule.remove() await message.edit_text(f"{user_info} 被 {user.mention_markdown_v2()} 放行", parse_mode=ParseMode.MARKDOWN_V2) @@ -138,7 +138,7 @@ class GroupJoiningVerification: elif result == "unban": await callback_query.answer(text="解除驱离", show_alert=False) await self.restore_member(context, chat.id, user_id) - if schedule := context.job_queue.scheduler.get_job(f"{chat.id}|{user_id}|clean_join"): + if schedule := context.job_queue.scheduler.get_job(f"{chat.id}|{user_id}|auth_clean_join_message"): schedule.remove() await message.edit_text(f"{user_info} 被 {user.mention_markdown_v2()} 解除驱离", parse_mode=ParseMode.MARKDOWN_V2) @@ -180,7 +180,7 @@ class GroupJoiningVerification: buttons = [[InlineKeyboardButton("驱离", callback_data=f"auth_admin|kick|{user.id}")]] await callback_query.answer(text="验证成功", show_alert=False) await self.restore_member(context, chat.id, user_id) - if schedule := context.job_queue.scheduler.get_job(f"{chat.id}|{user.id}|clean_join"): + if schedule := context.job_queue.scheduler.get_job(f"{chat.id}|{user.id}|auth_clean_join_message"): schedule.remove() text = f"{user.mention_markdown_v2()} 验证成功,向着星辰与深渊!\n" \ f"问题:{escape_markdown(question, version=2)} \n" \ @@ -278,13 +278,13 @@ class GroupJoiningVerification: raise error context.job_queue.run_once(callback=self.kick_member_job, when=self.time_out, name=f"{chat.id}|{user.id}|auth_kick", chat_id=chat.id, user_id=user.id, - job_kwargs={"replace_existing": True}) + job_kwargs={"replace_existing": True, "id": f"{chat.id}|{user.id}|auth_kick"}) context.job_queue.run_once(callback=self.clean_message_job, when=self.time_out, data=message.message_id, name=f"{chat.id}|{user.id}|auth_clean_join_message", chat_id=chat.id, user_id=user.id, - job_kwargs={"replace_existing": True}) + job_kwargs={"replace_existing": True, "id": f"{chat.id}|{user.id}|auth_kick"}) context.job_queue.run_once(callback=self.clean_message_job, when=self.time_out, data=question_message.message_id, name=f"{chat.id}|{user.id}|auth_clean_question_message", chat_id=chat.id, user_id=user.id, - job_kwargs={"replace_existing": True}) + job_kwargs={"replace_existing": True, "id": f"{chat.id}|{user.id}|auth_kick"})