fix(aurora): fixed unknown user in history command
All checks were successful
Actions / Lint Code (Pylint) (push) Successful in 16s
Actions / Build Documentation (MkDocs) (push) Successful in 11s

This commit is contained in:
Seaswimmer 2024-02-13 18:28:06 -05:00
parent 69482c9f45
commit 1aa12e88ac
Signed by: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -152,16 +152,24 @@ async def fetch_user_dict(client: commands.Bot, user_id: str) -> dict:
user_dict = {"id": "?", "name": "Unknown User", "discriminator": "0"} user_dict = {"id": "?", "name": "Unknown User", "discriminator": "0"}
else: else:
user = client.get_user(int(user_id)) try:
user = client.get_user(int(user_id))
if user is None:
user = await client.fetch_user(int(user_id))
if user:
user_dict = { user_dict = {
"id": user.id, "id": user.id,
"name": user.name, "name": user.name,
"discriminator": user.discriminator, "discriminator": user.discriminator,
} }
else:
user_dict = {"id": user_id, "name": "Unknown User", "discriminator": "0"} except NotFound:
user_dict = {
"id": user_id,
"name": "Deleted User",
"discriminator": "0",
}
return user_dict return user_dict