55 lines
1.2 KiB
Markdown
55 lines
1.2 KiB
Markdown
# Task Force Beta Bot
|
|
|
|
General-purpose Telegram bot with modular handler architecture.
|
|
|
|
## Build & Run
|
|
|
|
```bash
|
|
cargo build --release
|
|
cargo run
|
|
```
|
|
|
|
## Configuration
|
|
|
|
Command-line arguments:
|
|
1. Token path (default: `/var/trust/task_force_beta_bot/telegram_token`)
|
|
2. Allowed chats path (default: `/var/trust/task_force_beta_bot/allowed_chats`)
|
|
|
|
```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 and allowed chats loading from /var/trust/
|
|
- `src/handlers/` - Message handlers (modular, each feature in own file)
|
|
- `src/utils/` - Shared utilities
|
|
|
|
## Adding New Handlers
|
|
|
|
1. Create `src/handlers/new_feature.rs`
|
|
2. Export in `src/handlers/mod.rs`
|
|
3. Add handler branch in `handlers::schema()`
|
|
|
|
## Current Features
|
|
|
|
### Instagram Link Cleaning (`handlers/instagram.rs`)
|
|
|
|
Strips tracking parameters from Instagram links:
|
|
- `igsh`, `igshid` - Instagram share tracking
|
|
- `utm_*` - UTM campaign tracking
|
|
- `ref` - Referral tracking
|
|
- `fbclid` - Facebook click ID
|
|
- `si` - Session identifier
|