🐛 Fix sudo list deleted user

This commit is contained in:
xtaodada 2023-05-22 22:57:23 +08:00
parent 3a9fdced62
commit 41db62feb0
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 9 additions and 5 deletions

View File

@ -84,10 +84,14 @@ async def sudo_change(client: Client, message: Message):
if len(sudo) == 0:
return await edit_delete(message, f"__{lang('sudo_no_one')}__")
text = f"**{lang('sudo_list')}**\n\n"
for i in sudo:
for i in sudo.copy():
try:
if i > 0:
user = await client.get_users(i)
if user.is_deleted:
sudo.remove(i)
sqlite["sudo_list"] = sudo
continue
text += f"{user.mention()} - {' '.join(permissions.get_roles_for_user(str(i)))}\n"
else:
chat = await client.get_chat(i)

View File

@ -5,16 +5,16 @@ pytz>=2023.3
PyYAML>=6.0
coloredlogs>=15.0.1
psutil>=5.8.0
httpx==0.24.0
httpx==0.24.1
apscheduler>=3.10.1
sqlitedict~=2.1.0
casbin==1.18.2
sentry-sdk==1.21.1
sentry-sdk==1.23.1
PyQRCode>=1.2.1
PyPng
fastapi==0.95.1
fastapi==0.95.2
amis-python==1.0.7
python-jose
uvicorn
pydantic==1.10.7
starlette==0.26.1
starlette==0.27.0