38 lines
904 B
Markdown
38 lines
904 B
Markdown
# Telegram Bot
|
|
|
|
General-purpose Telegram bot with modular handler architecture.
|
|
|
|
## Build & Run
|
|
|
|
```bash
|
|
cargo build --release
|
|
cargo run
|
|
```
|
|
|
|
## Configuration
|
|
|
|
Bot token must be placed at: `/var/trust/instagram_link_stripper/telegram_token`
|
|
|
|
## Architecture
|
|
|
|
- `src/main.rs` - Entry point, dispatcher setup
|
|
- `src/config.rs` - Token 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
|