From 1c6d2456ed844c1c48e3d910649f09486e0089b7 Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Tue, 4 Jun 2024 00:04:46 -0400 Subject: [PATCH] misc(aurora): changed `aurora.utilities.utils.get_bool_emoji` to use `match/case` instead of `if/else` --- aurora/utilities/utils.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/aurora/utilities/utils.py b/aurora/utilities/utils.py index 96eea2b..f2adae0 100644 --- a/aurora/utilities/utils.py +++ b/aurora/utilities/utils.py @@ -152,11 +152,13 @@ async def send_evidenceformat(interaction: Interaction, moderation_id: int) -> N def get_bool_emoji(value: Optional[bool]) -> str: """Returns a unicode emoji based on a boolean value.""" - if value is True: - return "\N{WHITE HEAVY CHECK MARK}" - if value is False: - return "\N{NO ENTRY SIGN}" - return "\N{BLACK QUESTION MARK ORNAMENT}\N{VARIATION SELECTOR-16}" + match value: + case True: + return "\N{WHITE HEAVY CHECK MARK}" + case False: + return "\N{NO ENTRY SIGN}" + case _: + return "\N{BLACK QUESTION MARK ORNAMENT}\N{VARIATION SELECTOR-16}" def get_pagesize_str(value: Union[int, None]) -> str: