mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 12:55:38 +00:00
groupindex fix a bug
This commit is contained in:
parent
6b1514bc51
commit
74d3d03129
@ -71,14 +71,17 @@ async def group_index(context):
|
|||||||
text += f'活跃人数:{member_counts} 人\n' \
|
text += f'活跃人数:{member_counts} 人\n' \
|
||||||
f'总消息数:{msg_counts} 条\n'
|
f'总消息数:{msg_counts} 条\n'
|
||||||
if admin:
|
if admin:
|
||||||
text += f'加群 {join_count} 人,退群 {leave_count} 人\n' \
|
text += f'加群 {join_count} 人,退群 {leave_count} 人\n'
|
||||||
text += f'最活跃的小可爱们:\n'
|
text += f'最活跃的小可爱们:\n'
|
||||||
# 字典倒序排序
|
# 字典倒序排序
|
||||||
member_count = sorted(member_count.items(), key=lambda x: x[1], reverse=True)
|
member_count = sorted(member_count.items(), key=lambda x: x[1], reverse=True)
|
||||||
# 遍历列表
|
# 遍历列表
|
||||||
for i in range(min(len(member_count), 5)):
|
if len(member_count) == 0:
|
||||||
# 获取用户信息
|
text += "没有发言用户呢 ~"
|
||||||
target_user = await context.client(GetFullUserRequest(member_count[i][0]))
|
else:
|
||||||
first_name = target_user.user.first_name.replace("\u2060", "")
|
for i in range(min(len(member_count), 5)):
|
||||||
text += f'{first_name} `{member_count[i][1]}`\n'
|
# 获取用户信息
|
||||||
|
target_user = await context.client(GetFullUserRequest(member_count[i][0]))
|
||||||
|
first_name = target_user.user.first_name.replace("\u2060", "")
|
||||||
|
text += f'{first_name} `{member_count[i][1]}`\n'
|
||||||
await context.edit(text)
|
await context.edit(text)
|
||||||
|
@ -692,10 +692,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "groupindex",
|
"name": "groupindex",
|
||||||
"version": "1.1",
|
"version": "1.11",
|
||||||
"section": "daily",
|
"section": "daily",
|
||||||
"maintainer": "xtaodada",
|
"maintainer": "xtaodada",
|
||||||
"size": "3.1 kb",
|
"size": "3.2 kb",
|
||||||
"supported": true,
|
"supported": true,
|
||||||
"des-short": "获取群组当日活跃数据",
|
"des-short": "获取群组当日活跃数据",
|
||||||
"des": "获取群组当日活跃数据。\n指令:-groupindex"
|
"des": "获取群组当日活跃数据。\n指令:-groupindex"
|
||||||
|
Loading…
Reference in New Issue
Block a user