aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar bradtimmis <[email protected]>2021-11-09 20:20:19 -0500
committerGravatar bradtimmis <[email protected]>2021-11-09 20:20:19 -0500
commit57c13ff35801281b5e592c9f6c195093a2fc5c7b (patch)
tree135d58ae4de1321f46f6783686c5d13c3760b18e
parentfix: add import, handle no name match in embed (diff)
bug: handle multi word name entries and full input
-rw-r--r--bot/exts/utilities/colour.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/exts/utilities/colour.py b/bot/exts/utilities/colour.py
index 4528615b..cede3312 100644
--- a/bot/exts/utilities/colour.py
+++ b/bot/exts/utilities/colour.py
@@ -39,8 +39,10 @@ class Colour(commands.Cog):
input_colour = "random"
elif colour_mode in ("colour", "color"):
input_colour = rgb
+ elif colour_mode == "name":
+ input_colour = ctx.kwargs["user_colour_name"]
else:
- input_colour = ctx.args[2:][0]
+ input_colour = tuple(ctx.args[2:])
if colour_mode not in ("name", "hex", "random", "color", "colour"):
colour_mode = colour_mode.upper()
@@ -141,7 +143,7 @@ class Colour(commands.Cog):
await self.send_colour_response(ctx, hex_tuple)
@colour.command()
- async def name(self, ctx: commands.Context, user_colour_name: str) -> None:
+ async def name(self, ctx: commands.Context, *, user_colour_name: str) -> None:
"""Command to create an embed from a name input."""
hex_colour = self.match_colour_name(user_colour_name)
hex_tuple = ImageColor.getrgb(hex_colour)