From 72922d3bc0fef80bb292322f66ed2806fe2cead8 Mon Sep 17 00:00:00 2001 From: b miao Date: Thu, 3 Sep 2020 14:54:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dportball=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E6=89=80=E5=AF=BC=E8=87=B4=E7=9A=84=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.json | 4 ++-- portball.py | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/list.json b/list.json index 03ab5b7..79a0090 100644 --- a/list.json +++ b/list.json @@ -152,13 +152,13 @@ }, { "name": "portball", - "version": "1.21", + "version": "1.22", "section": "chat", "maintainer": "Pentacene", "size": "3.6 kb", "supported": true, "des-short": "回复你要临时禁言的人的消息来实现XX秒的禁言。", - "des": "这个人很懒,什么都没有留下。" + "des": "portball 原因 秒数" }, { "name": "resou", diff --git a/portball.py b/portball.py index 285af32..52ed965 100644 --- a/portball.py +++ b/portball.py @@ -18,6 +18,15 @@ async def portball(context): last_name = '' else: last_name = reply.sender.last_name + if len(action) < 2: + notification = await bot.send_message(context.chat_id, '格式是\n-portball 理由 秒数\n真蠢', reply_to = context.id) + await sleep(10) + await notification.delete() + try: + await context.delete() + except: + pass + return False if int(action[1])<60: notification = await bot.send_message(context.chat_id, '诶呀不要小于60秒啦', reply_to = context.id) await sleep(10)