aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Izan <[email protected]>2021-08-27 22:50:11 +0100
committerGravatar Izan <[email protected]>2021-08-27 23:01:34 +0100
commitd1743b3fb47ef20712c540fcb764b62a7f8df875 (patch)
tree65d6b18a6d3a2a2ee865e8d4180d730760d5bd8a
parentFix message getting sent twice (diff)
Implement requested changes to CoinSide converter
Converter is now case-insensitive and uses `self.CONSTANT` instead of `CoinSide.CONSTANT`
-rw-r--r--bot/exts/evergreen/coinflip.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/exts/evergreen/coinflip.py b/bot/exts/evergreen/coinflip.py
index bfd04843..d1762463 100644
--- a/bot/exts/evergreen/coinflip.py
+++ b/bot/exts/evergreen/coinflip.py
@@ -15,10 +15,11 @@ class CoinSide(commands.Converter):
async def convert(self, ctx: commands.Context, side: str) -> str:
"""Converts the provided `side` into the corresponding string."""
- if side in CoinSide.HEADS:
+ side = side.lower()
+ if side in self.HEADS:
return "heads"
- if side in CoinSide.TAILS:
+ if side in self.TAILS:
return "tails"
raise commands.BadArgument(f"{side!r} is not a valid coin side.")