From 5c0e3e5438e58e33954cdbfd4bff0b31d44310b5 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Wed, 12 Aug 2020 14:11:33 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A9=20portball=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.json | 2 +- portball.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/list.json b/list.json index d651da6..27a1f0e 100644 --- a/list.json +++ b/list.json @@ -152,7 +152,7 @@ }, { "name": "portball", - "version": "1.0", + "version": "1.1", "section": "chat", "maintainer": "丢失了", "size": "3.0 kb", diff --git a/portball.py b/portball.py index ac9eb42..ec174e4 100644 --- a/portball.py +++ b/portball.py @@ -6,7 +6,7 @@ from datetime import timedelta from telethon.tl.types import ChannelParticipantsAdmins -@listener(incoming=True, outgoing=True, command="portball", +@listener(is_plugin=True, outgoing=True, command="portball", description="回复你要临时禁言的人的消息来实现XX秒的禁言。", parameters="<理由> <时间 单位:秒>") async def portball(context): @@ -18,6 +18,9 @@ async def portball(context): last_name = '' else: last_name = reply.sender.last_name + if not len(action) == 2: + await context.edit('你好蠢诶,没有参数我怎么禁言嘛。') + return if int(action[1])<60: notification = await bot.send_message(context.chat_id, '诶呀不要小于60秒啦') await sleep(10)