From f20a4abc81dc2738fa8425e621c1fab6eb354be0 Mon Sep 17 00:00:00 2001 From: T-BENZIN Date: Wed, 4 Feb 2026 21:42:25 +0500 Subject: [PATCH] Original message is put in lower case whole and redundant .lower() methods are removed. Modified usage message. --- fitnessCog/fitness.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fitnessCog/fitness.py b/fitnessCog/fitness.py index a95b134..3c16bd3 100644 --- a/fitnessCog/fitness.py +++ b/fitnessCog/fitness.py @@ -42,12 +42,11 @@ class FitnessCog(commands.Cog): if not content.startswith("!"): return - cmdline = content[1:].strip() + cmdline = content[1:].strip().lower() if not cmdline: return cmd, *rest = cmdline.split(" ", 1) - cmd = cmd.lower() arg = rest[0].strip() if rest else "" if cmd == "getunits": @@ -68,7 +67,6 @@ class FitnessCog(commands.Cog): ) return - activity = activity.lower() path = self.activity_units_path(activity) if not path.exists(): @@ -88,7 +86,6 @@ class FitnessCog(commands.Cog): ) return - activity = activity.lower() path = self.activity_log_path(activity) if not path.exists(): @@ -105,11 +102,11 @@ class FitnessCog(commands.Cog): parts = message.content[1:].strip().split() if len(parts) < 2: await message.reply( - "Usage: `! [unit]` (example: `!pushups 20 reps`)" + "Usage: `! [unit]` (example: `!pushups 20` or `!run 5 km`)" ) return - activity = parts[0].lower() + activity = parts[0] try: value = float(parts[1]) @@ -119,7 +116,7 @@ class FitnessCog(commands.Cog): ) return - unit = parts[2].lower() if len(parts) > 2 else "m" + unit = parts[2] if len(parts) > 2 else "m" timestamp = int(message.created_at.timestamp()) username = message.author.name