feat(tg-fitness-bot): initial Telegram workout tracker bot
Python bot that parses workout messages (Exercise: SetsxRepsxWeight), detects supersets from consecutive lines, extracts machine IDs, stores both raw message text and parsed data in SQLite, and reads original timestamps from forwarded Saved Messages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
817cf8fd95
8 changed files with 590 additions and 0 deletions
40
flake.nix
Normal file
40
flake.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
description = "BigBiggerBiggestBot — Telegram fitness tracker";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
python = pkgs.python3;
|
||||
|
||||
pythonEnv = python.withPackages (ps: with ps; [
|
||||
python-telegram-bot
|
||||
python-dotenv
|
||||
]);
|
||||
in
|
||||
{
|
||||
# `nix develop` — drop into a shell with everything available
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [ pythonEnv ];
|
||||
shellHook = ''
|
||||
echo "💪 BigBiggerBiggestBot dev shell"
|
||||
echo " Run: python bot.py"
|
||||
'';
|
||||
};
|
||||
|
||||
# `nix run` — start the bot from the current directory
|
||||
apps.default = {
|
||||
type = "app";
|
||||
program = toString (pkgs.writeShellScript "run-bot" ''
|
||||
exec ${pythonEnv}/bin/python "$PWD/bot.py"
|
||||
'');
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue