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)