portball groupindex 修复错误

This commit is contained in:
xtaodada 2021-10-03 11:56:50 +08:00
parent 9de2c867dc
commit 7b349011ed
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
3 changed files with 9 additions and 4 deletions

View File

@ -86,6 +86,8 @@ async def group_index(context):
for i in range(min(len(member_count), 5)): for i in range(min(len(member_count), 5)):
# 获取用户信息 # 获取用户信息
target_user = await context.client(GetFullUserRequest(member_count[i][0])) target_user = await context.client(GetFullUserRequest(member_count[i][0]))
first_name = target_user.user.first_name.replace("\u2060", "") first_name = target_user.user.first_name
if first_name:
first_name = first_name.replace("\u2060", "")
text += f'{first_name} `{member_count[i][1]}`\n' text += f'{first_name} `{member_count[i][1]}`\n'
await context.edit(text) await context.edit(text)

View File

@ -152,7 +152,7 @@
}, },
{ {
"name": "portball", "name": "portball",
"version": "1.451", "version": "1.452",
"section": "chat", "section": "chat",
"maintainer": "Pentacene", "maintainer": "Pentacene",
"size": "2.8 kb", "size": "2.8 kb",
@ -692,7 +692,7 @@
}, },
{ {
"name": "groupindex", "name": "groupindex",
"version": "1.12", "version": "1.121",
"section": "daily", "section": "daily",
"maintainer": "xtaodada", "maintainer": "xtaodada",
"size": "3.2 kb", "size": "3.2 kb",

View File

@ -1,4 +1,4 @@
from pagermaid import bot, log from pagermaid import bot, log, user_id
from pagermaid.listener import listener from pagermaid.listener import listener
from telethon.errors import rpcerrorlist from telethon.errors import rpcerrorlist
from asyncio import sleep from asyncio import sleep
@ -19,6 +19,9 @@ async def portball(context):
last_name = '' last_name = ''
else: else:
last_name = reply.sender.last_name last_name = reply.sender.last_name
if reply.sender.id == user_id:
await context.edit('无法禁言自己。')
return
else: else:
await context.edit('无法获取所回复的用户。') await context.edit('无法获取所回复的用户。')
return return