Attempting to be a bit more direct about activity path #15

Merged
AllfatherHatt merged 1 commits from debug_fitness into master 2026-02-04 17:50:47 +01:00
No description provided.
AllfatherHatt added 1 commit 2026-02-04 14:03:41 +01:00
AllfatherHatt requested review from T-BENZIN 2026-02-04 14:03:51 +01:00
T-BENZIN reviewed 2026-02-04 15:13:34 +01:00
@ -59,0 +105,4 @@
parts = message.content[1:].strip().split()
if len(parts) < 2:
await message.reply(
"Usage: `!<activity> <value> [unit]` (example: `!pushups 20 reps`)"
Owner

Activity "Pushups" specifically consists of

{
  "convertable": false
}

So "reps" part may be omitted, !pushups 20 will work the same.

Activity "Pushups" specifically consists of ```json { "convertable": false } ``` So "reps" part may be omitted, `!pushups 20` will work the same.
T-BENZIN reviewed 2026-02-04 15:18:38 +01:00
@ -14,1 +22,4 @@
self.threads_id.append(int(x))
self.confirm_reactions = os.getenv("CONFIRMATION_REACTIONS", "🐈💨")
self.bundled_activities_dir: Path = bundled_data_path(self) / "activities"
Owner
self.bundled_activities_dir: Path = os.path.join(bundled_data_path(self), "activities")

^this should be used instead for path joining

```python self.bundled_activities_dir: Path = os.path.join(bundled_data_path(self), "activities") ``` ~~^this should be used instead for path joining~~
Owner

Nvm, I didn't realized it's the Path lib thing.

Nvm, I didn't realized it's the Path lib thing.
T-BENZIN marked this conversation as resolved
T-BENZIN reviewed 2026-02-04 15:25:26 +01:00
@ -30,1 +48,3 @@
await self.get_log_file(message)
cmd, *rest = cmdline.split(" ", 1)
cmd = cmd.lower()
Owner

Maybe put entire cmdline value to .lower instead?

Maybe put entire `cmdline` value to `.lower` instead?
T-BENZIN reviewed 2026-02-04 15:26:55 +01:00
@ -44,0 +68,4 @@
)
return
activity = activity.lower()
Owner

if cmdline = cmdline.lower() on line 48, then this .lower will become redundant

if `cmdline = cmdline.lower()` on line 48, then this `.lower` will become redundant
T-BENZIN reviewed 2026-02-04 15:27:02 +01:00
@ -53,0 +88,4 @@
)
return
activity = activity.lower()
Owner

if cmdline = cmdline.lower() on line 48, then this .lower will become redundant

if `cmdline = cmdline.lower()` on line 48, then this `.lower` will become redundant
T-BENZIN reviewed 2026-02-04 15:27:14 +01:00
@ -59,0 +109,4 @@
)
return
activity = parts[0].lower()
Owner

if cmdline = cmdline.lower() on line 48, then this .lower will become redundant

if `cmdline = cmdline.lower()` on line 48, then this `.lower` will become redundant
T-BENZIN reviewed 2026-02-04 15:27:28 +01:00
@ -59,0 +119,4 @@
)
return
unit = parts[2].lower() if len(parts) > 2 else "m"
Owner

if cmdline = cmdline.lower() on line 48, then this .lower will become redundant

if `cmdline = cmdline.lower()` on line 48, then this `.lower` will become redundant
Owner

Also, should probably put default unit in units' json file with falling back to "m", now that I think of it...

Also, should probably put default unit in units' json file with falling back to "m", now that I think of it...
T-BENZIN approved these changes 2026-02-04 15:38:02 +01:00
AllfatherHatt merged commit 6cf112be49 into master 2026-02-04 17:50:47 +01:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Kanium-PUBLIC/KaniumCogs#15
No description provided.