️ fuckadmin 优化潜水列表为 0 的显示问题

This commit is contained in:
xtaodada 2021-07-11 23:08:23 +08:00
parent abaa1a518d
commit a315456881
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 8 additions and 3 deletions

View File

@ -42,12 +42,12 @@ def mention_user(user):
description='列出群组中所有潜水超过 n 天的管理员。n>=7', description='列出群组中所有潜水超过 n 天的管理员。n>=7',
parameters="<day>") parameters="<day>")
async def fuck_admin(context): async def fuck_admin(context):
admins = 0
if context.is_group: if context.is_group:
pass pass
else: else:
await context.edit('请在群组中运行。') await context.edit('请在群组中运行。')
return return
await context.edit('遍历管理员中。')
# 读取天数 # 读取天数
text = '' text = ''
if len(context.parameter) == 1: if len(context.parameter) == 1:
@ -72,10 +72,15 @@ async def fuck_admin(context):
msg += 1 msg += 1
time = eval_time(context, message, day) time = eval_time(context, message, day)
if time: if time:
admins += 1
text += f'{mention_user(x)} {time}\n' text += f'{mention_user(x)} {time}\n'
break break
if msg == 1: if msg == 1:
msg = 0 msg = 0
else: else:
admins += 1
text += f'{mention_user(x)} 从未发言\n' text += f'{mention_user(x)} 从未发言\n'
await context.edit(text) if admins > 0:
await context.edit(text)
else:
await context.edit('没有发现潜水超过 n 天的管理员呢,大家都很活跃!')

View File

@ -572,7 +572,7 @@
}, },
{ {
"name": "fuckadmin", "name": "fuckadmin",
"version": "1.0", "version": "1.01",
"section": "daily", "section": "daily",
"maintainer": "xtaodada", "maintainer": "xtaodada",
"size": "2.7 kb", "size": "2.7 kb",