Rust Telegram Watchlist Orchestrator
An asynchronous Telegram bot engineered in Rust for managing localized media watchlists, featuring randomized suggestion engines and flat-file state persistence.
Performance & metrics
- Eliminated network latency overhead typical of remote database connections by reducing state reads/writes to synchronous disk I/O
- Memory footprint and CPU cycles minimized by utilizing
HashSetfor O(1) lookups during duplicate prevention logic
Why I built it
Designed to solve a specific UX friction point: logging media consumption while watching on a Smart TV. Standard web interfaces and TV remotes are highly inefficient for text entry. By exposing the state management interface via a Telegram bot, the user can instantly query, log, and receive randomized media suggestions directly from their mobile device with zero context switching. The architecture was kept intentionally lightweight (statically compiled Rust, flat-file storage) to eliminate the operational overhead of maintaining a relational database.
Architecture & decisions
Built on the tokio asynchronous runtime utilizing the teloxide framework for Telegram API bindings. State persistence is handled via a localized flat-file system. To optimize I/O and deduplication, file contents are loaded into memory as std::collections::HashSet structures, providing O(1) insertion checks. Following state mutation, data is lexicographically sorted and flushed to disk. The bot also implements a custom string buffering algorithm (send_long_message) to dynamically chunk payloads exceeding Telegram's strict 4096-byte message limits.
Key features
- Asynchronous command routing and dispatch via the
teloxideREPL architecture - Flat-file state persistence with
HashSet-driven deduplication and automatic lexicographical sorting - Dynamic message chunking algorithm to strictly adhere to Telegram API payload constraints
- Sub-string resolution matching to provide graceful fallback suggestions for inexact user input
Related projects
Yt-dlp & FFmpeg Telegram Media Archiver Bot
An asynchronous Rust-based Telegram bot engine that orchestrates yt-dlp and FFmpeg subprocesses to securely download, compress, and serve media from X (Twitter) and YouTube.
- Rust
- Shell
- Tokio
- +5
Lain Discord Bot (Rust)
A high-performance, asynchronous Discord bot written in Rust, featuring targeted message delivery and strict RBAC (Role-Based Access Control) for administrators.
- Rust
- Serenity
- Discord API
Telegram Lein Bot
An automated Telegram assistant equipped with custom command trees and a competitive, state-tracking trivia module.
- Python
- Aiogram
- Telegram API
Need something similar?
I can build a system like this for you, too.
Describe your project in a few sentences, and we'll work out the right approach and an estimated scope together.