make nix module

This commit is contained in:
Fabian Montero 2026-05-16 14:25:20 -06:00
parent a4b8bdd8c0
commit 3ff112b1cd
Signed by: fabian
GPG key ID: 3EDA9AE3937CCDE3
6 changed files with 96 additions and 35 deletions

View file

@ -1,4 +1,4 @@
# Telegram Bot
# Task Force Beta Bot
General-purpose Telegram bot with modular handler architecture.
@ -6,17 +6,38 @@ General-purpose Telegram bot with modular handler architecture.
```bash
cargo build --release
cargo run
```
## Configuration
## Usage
Bot token must be placed at: `/var/trust/instagram_link_stripper/telegram_token`
```
task_force_beta_bot <token_file> <allowed_chats_file>
```
Both arguments are required:
- `token_file` - Path to file containing the Telegram bot token
- `allowed_chats_file` - Path to file containing allowed chat IDs
Example:
```bash
cargo run -- /path/to/token /path/to/allowed_chats
```
### Allowed Chats File
One chat ID per line. Lines starting with `#` are comments.
```
# My group
-100123456789
```
The bot ignores messages from chats not in this list.
## Architecture
- `src/main.rs` - Entry point, dispatcher setup
- `src/config.rs` - Token loading from /var/trust/
- `src/config.rs` - Token and allowed chats loading from CLI arguments
- `src/handlers/` - Message handlers (modular, each feature in own file)
- `src/utils/` - Shared utilities