add tag all function

This commit is contained in:
Fabian Montero 2026-05-16 19:26:12 -06:00
parent 3ff112b1cd
commit 6e59919c62
Signed by: fabian
GPG key ID: 3EDA9AE3937CCDE3
8 changed files with 141 additions and 31 deletions

View file

@ -41,6 +41,25 @@ The bot ignores messages from chats not in this list.
- `src/handlers/` - Message handlers (modular, each feature in own file)
- `src/utils/` - Shared utilities
## NixOS Deployment
Module location: `/home/fabian/nix/sys/modules/task-force-beta-bot.nix`
```nix
local.sys.task-force-beta-bot = {
enable = true;
tokenFile = "/var/trust/task_force_beta_bot/telegram_token";
allowedChats = [ (-1001234567890) ]; # Negative IDs for groups
};
```
The module:
- Fetches and builds the package from git
- Generates the allowed chats file in the nix store
- Runs as a hardened systemd service (`task-force-beta-bot.service`)
After code changes: update `rev` and `hash` in the module's `fetchgit` block.
## Adding New Handlers
1. Create `src/handlers/new_feature.rs`
@ -57,3 +76,11 @@ Strips tracking parameters from Instagram links:
- `ref` - Referral tracking
- `fbclid` - Facebook click ID
- `si` - Session identifier
### Tag All (`handlers/tag_all.rs`)
WhatsApp-style @all mentions. When a message contains "@all", bot replies tagging everyone it has seen.
- Tracks users by observing messages (requires privacy mode disabled)
- In-memory only - resets on restart
- Uses MarkdownV2 text mentions