Compare commits
No commits in common. "d51bc4965e64d37e6abc846356979ea31ea0cc70" and "6cf112be49999de8b47f18dab74c859ca23f3a0a" have entirely different histories.
d51bc4965e
...
6cf112be49
@ -42,11 +42,12 @@ class FitnessCog(commands.Cog):
|
|||||||
if not content.startswith("!"):
|
if not content.startswith("!"):
|
||||||
return
|
return
|
||||||
|
|
||||||
cmdline = content[1:].strip().lower()
|
cmdline = content[1:].strip()
|
||||||
if not cmdline:
|
if not cmdline:
|
||||||
return
|
return
|
||||||
|
|
||||||
cmd, *rest = cmdline.split(" ", 1)
|
cmd, *rest = cmdline.split(" ", 1)
|
||||||
|
cmd = cmd.lower()
|
||||||
arg = rest[0].strip() if rest else ""
|
arg = rest[0].strip() if rest else ""
|
||||||
|
|
||||||
if cmd == "getunits":
|
if cmd == "getunits":
|
||||||
@ -67,6 +68,7 @@ class FitnessCog(commands.Cog):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
activity = activity.lower()
|
||||||
path = self.activity_units_path(activity)
|
path = self.activity_units_path(activity)
|
||||||
|
|
||||||
if not path.exists():
|
if not path.exists():
|
||||||
@ -86,6 +88,7 @@ class FitnessCog(commands.Cog):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
activity = activity.lower()
|
||||||
path = self.activity_log_path(activity)
|
path = self.activity_log_path(activity)
|
||||||
|
|
||||||
if not path.exists():
|
if not path.exists():
|
||||||
@ -102,11 +105,11 @@ class FitnessCog(commands.Cog):
|
|||||||
parts = message.content[1:].strip().split()
|
parts = message.content[1:].strip().split()
|
||||||
if len(parts) < 2:
|
if len(parts) < 2:
|
||||||
await message.reply(
|
await message.reply(
|
||||||
"Usage: `!<activity> <value> [unit]` (example: `!pushups 20` or `!run 5 km`)"
|
"Usage: `!<activity> <value> [unit]` (example: `!pushups 20 reps`)"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
activity = parts[0]
|
activity = parts[0].lower()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
value = float(parts[1])
|
value = float(parts[1])
|
||||||
@ -116,7 +119,7 @@ class FitnessCog(commands.Cog):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
unit = parts[2] if len(parts) > 2 else "m"
|
unit = parts[2].lower() if len(parts) > 2 else "m"
|
||||||
|
|
||||||
timestamp = int(message.created_at.timestamp())
|
timestamp = int(message.created_at.timestamp())
|
||||||
username = message.author.name
|
username = message.author.name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user