mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 12:51:35 +00:00
修改 plugins.auth
的管理进行的封禁时间改为永久封禁
This commit is contained in:
parent
e7dae95944
commit
d77db74278
@ -40,7 +40,7 @@ class Auth:
|
||||
self.generator = Generator(MT19937(int(self.send_time)))
|
||||
return int(self.generator.uniform(low, high))
|
||||
|
||||
async def kick_member(self, context: CallbackContext, chat_id: int, user_id: int) -> bool:
|
||||
async def kick_member(self, context: CallbackContext, chat_id: int, user_id: int, kick_time: int = -1) -> bool:
|
||||
try:
|
||||
await context.bot.ban_chat_member(chat_id=chat_id, user_id=user_id,
|
||||
until_date=int(time.time()) + self.kick_time)
|
||||
@ -114,7 +114,7 @@ class Auth:
|
||||
parse_mode=ParseMode.MARKDOWN_V2)
|
||||
else:
|
||||
await callback_query.answer(text="驱离", show_alert=False)
|
||||
await self.kick_member(context, chat.id, user_id)
|
||||
await context.bot.ban_chat_member(chat.id, user_id)
|
||||
await message.edit_text(f"{user_info} 被 {user.mention_markdown_v2()} 驱离",
|
||||
parse_mode=ParseMode.MARKDOWN_V2)
|
||||
if schedule := context.job_queue.scheduler.get_job(f"{chat.id}|{user_id}|auth_kick"):
|
||||
|
Loading…
Reference in New Issue
Block a user