From 1de5e9b905310eb4745b9b5c83561dea3a289ea9 Mon Sep 17 00:00:00 2001 From: bradtimmis Date: Tue, 9 Nov 2021 20:39:39 -0500 Subject: chore: pull hex match out of try/except block --- bot/exts/utilities/colour.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'bot/exts/utilities/colour.py') diff --git a/bot/exts/utilities/colour.py b/bot/exts/utilities/colour.py index cede3312..656dddba 100644 --- a/bot/exts/utilities/colour.py +++ b/bot/exts/utilities/colour.py @@ -228,10 +228,9 @@ class Colour(commands.Cog): choices=self.colour_mapping.keys(), score_cutoff=80 ) - hex_match = f"#{self.colour_mapping[match]}" except (ValueError, TypeError): raise commands.BadArgument(message=f"No color found for: `{input_colour_name}`") - return hex_match + return f"#{self.colour_mapping[match]}" def setup(bot: Bot) -> None: -- cgit v1.2.3