💩 portball 错误修复

This commit is contained in:
xtaodada 2020-08-12 14:11:33 +08:00
parent d296df8424
commit 5c0e3e5438
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 5 additions and 2 deletions

View File

@ -152,7 +152,7 @@
}, },
{ {
"name": "portball", "name": "portball",
"version": "1.0", "version": "1.1",
"section": "chat", "section": "chat",
"maintainer": "丢失了", "maintainer": "丢失了",
"size": "3.0 kb", "size": "3.0 kb",

View File

@ -6,7 +6,7 @@ from datetime import timedelta
from telethon.tl.types import ChannelParticipantsAdmins from telethon.tl.types import ChannelParticipantsAdmins
@listener(incoming=True, outgoing=True, command="portball", @listener(is_plugin=True, outgoing=True, command="portball",
description="回复你要临时禁言的人的消息来实现XX秒的禁言。", description="回复你要临时禁言的人的消息来实现XX秒的禁言。",
parameters="<理由> <时间 单位:秒>") parameters="<理由> <时间 单位:秒>")
async def portball(context): async def portball(context):
@ -18,6 +18,9 @@ async def portball(context):
last_name = '' last_name = ''
else: else:
last_name = reply.sender.last_name last_name = reply.sender.last_name
if not len(action) == 2:
await context.edit('你好蠢诶,没有参数我怎么禁言嘛。')
return
if int(action[1])<60: if int(action[1])<60:
notification = await bot.send_message(context.chat_id, '诶呀不要小于60秒啦') notification = await bot.send_message(context.chat_id, '诶呀不要小于60秒啦')
await sleep(10) await sleep(10)