diff options
author | 2021-09-19 08:20:18 -0400 | |
---|---|---|
committer | 2021-10-05 16:42:48 +0100 | |
commit | 0f777557d67bdf117eafcba3ab98192dd420cf96 (patch) | |
tree | b2b29420a0be13542a63b35e3c1ad629f0193764 | |
parent | Fix Flake8 spacing errors (diff) |
Reword json file variables and mapping
-rw-r--r-- | bot/exts/utilities/color.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bot/exts/utilities/color.py b/bot/exts/utilities/color.py index eb9d5f4d..94c9d337 100644 --- a/bot/exts/utilities/color.py +++ b/bot/exts/utilities/color.py @@ -24,9 +24,9 @@ ERROR_MSG = """The color code {user_color} is not a possible color combination. \nHex: #000000-#FFFFFF """ -COLOR_LIST = "bot/resources/utilities/ryanzec_colours.json" -with open(COLOR_LIST) as f: - COLOR_JSON = json.load(f) +COLOR_JSON_PATH = "bot/resources/utilities/ryanzec_colours.json" +with open(COLOR_JSON_PATH) as f: + COLOR_MAPPING = json.load(f) # define color command @@ -199,9 +199,9 @@ class Color(commands.Cog): @staticmethod def match_color(user_color: str) -> str: """Use fuzzy matching to return a hex color code based on the user's input.""" - match, certainty, _ = process.extractOne(query=user_color, choices=COLOR_JSON.keys(), score_cutoff=50) + match, certainty, _ = process.extractOne(query=user_color, choices=COLOR_MAPPING.keys(), score_cutoff=50) logger.debug(f"{match = }, {certainty = }") - hex_match = COLOR_JSON[match] + hex_match = COLOR_MAPPING[match] logger.debug(f"{hex_match = }") return match, hex_match |