fix(moderation): fixed messed up embeds

This commit is contained in:
Seaswimmer 2023-12-17 13:02:46 -05:00
parent ee7b64cc78
commit e1d84dfc4b
Signed by untrusted user: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -60,9 +60,9 @@ async def embed_factory(embed_type: str, color: Color, /, interaction: Interact
elif case_dict['target_type'] == 'CHANNEL':
target_user = await fetch_channel_dict(interaction, case_dict['target_id'])
if target_user['mention']:
target_name = f"{target_user['mention']} ({target_user['id']})"
target_name = f"{target_user['mention']}"
else:
target_name = f"`{target_user['name']}` ({target_user['id']})"
target_name = f"`{target_user['name']}`"
moderator_user = await fetch_user_dict(interaction, case_dict['moderator_id'])
moderator_name = f"`{moderator_user['name']}`" if moderator_user['discriminator'] == "0" else f"`{moderator_user['name']}#{moderator_user['discriminator']}`"
@ -127,9 +127,9 @@ async def embed_factory(embed_type: str, color: Color, /, interaction: Interact
elif case_dict['target_type'] == 'CHANNEL':
target_user = await fetch_channel_dict(interaction, case_dict['target_id'])
if target_user['mention']:
target_name = f"{target_user['mention']} ({target_user['id']})"
target_name = f"{target_user['mention']}"
else:
target_name = f"`{target_user['name']}` ({target_user['id']})"
target_name = f"`{target_user['name']}`"
moderator_user = await fetch_user_dict(interaction, case_dict['moderator_id'])
moderator_name = moderator_user['name'] if moderator_user['discriminator'] == "0" else f"{moderator_user['name']}#{moderator_user['discriminator']}"
@ -157,7 +157,7 @@ async def embed_factory(embed_type: str, color: Color, /, interaction: Interact
if target_user['mention']:
target_name = target_user['mention']
else:
target_name = target_user['name']
target_name = f"`{target_user['name']}`"
moderator_user = await fetch_user_dict(interaction, case_dict['moderator_id'])
moderator_name = moderator_user['name'] if moderator_user['discriminator'] == "0" else f"{moderator_user['name']}#{moderator_user['discriminator']}"