修复portball条件缺失所导致的报错

This commit is contained in:
b miao 2020-09-03 14:54:58 +08:00
parent 2f3febf4b6
commit 72922d3bc0
2 changed files with 11 additions and 2 deletions

View File

@ -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",

View File

@ -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)