aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar bradtimmis <[email protected]>2021-11-03 20:40:15 -0400
committerGravatar bradtimmis <[email protected]>2021-11-03 20:40:15 -0400
commitc869faf32ceeadc94a8a38b5370706a4b6da32ae (patch)
tree18e87d601c6b7075d5c998897ac9802913b5afad /bot
parentFix lint errors of eac9d3b4194004894d4f4e50862f184db695d402 (diff)
fix: return None if no name match is found
Diffstat (limited to 'bot')
-rw-r--r--bot/exts/utilities/color.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/utilities/color.py b/bot/exts/utilities/color.py
index c79e7620..9c801413 100644
--- a/bot/exts/utilities/color.py
+++ b/bot/exts/utilities/color.py
@@ -28,8 +28,8 @@ class Colour(commands.Cog):
async def send_colour_response(self, ctx: commands.Context, rgb: tuple[int, int, int]) -> None:
"""Create and send embed from user given colour information."""
name = self._rgb_to_name(rgb)
- if name == "No match found":
- name = None
+ if name is None:
+ name = "No match found"
try:
colour_or_color = ctx.invoked_parents[0]
@@ -207,7 +207,7 @@ class Colour(commands.Cog):
)
colour_name = [name for name, hex_code in self.colour_mapping.items() if hex_code == match][0]
except TypeError:
- colour_name = "No match found"
+ colour_name = None
return colour_name
def match_colour_name(self, input_colour_name: str) -> str: