Projects & Experience

2026

AI Companion

A Telegram bot with a configurable personality for private and group chats. It uses conversation history as context and supports scheduled group reviews, diagnostics and multiple Cloudflare Workers AI credential slots; the bot is deployed and maintained on a private server.

Project roles
Python DeveloperBackend DeveloperTelegram Bot DeveloperAI Integration EngineerServer Administrator

Technologies and tools

Python 3.11asynciopython-telegram-botTelegram Bot APIhttpxSQLiteJSONCSVpython-dotenvCloudflare Workers AIpsutilWindows 10macOSLinuxBashBatchPowerShellWindows CIMNVIDIA-SMIunittestRussian and English documentation
  • Built a Telegram bot to reply to mentions and replies to its own messages in allowed groups. Configured the group allowlist and automatic exit from unapproved chats; restricted private-chat generation to the owner and added a predefined response for other users.
  • Configured isolated SQLite history for each chat and a context window of up to 100 primary records by default. Implemented persistence for message text, media captions and descriptions, authors, timestamps, quotes and reply relationships up to two levels where Telegram provides the source data; histories remain isolated between chats.
  • Created editable prompts for the bot’s personality and style, scheduled group reviews, messages after long inactivity and the fixed private-chat response. Configured hourly reviews of new group messages by default, plus a separate activity check every 15 minutes that can prompt the bot to join a group after 72 hours without human messages.
  • Integrated Cloudflare Workers AI through asynchronous HTTP requests with httpx. Implemented one to five sequential credential slots, per-slot usage and error tracking, cooldowns when quotas are exhausted, UTC daily rollover and background availability recovery every five minutes for the first six hours of a new day and hourly afterwards; added bounded retries of up to three attempts for network failures, empty responses and server errors.
  • Built a generated-text check before sending and storing replies, with removal of recognized model metadata and substantial fragments copied from chat history. Added splitting for Telegram messages beyond the API limit and safe request retries for connection failures before transmission.
  • Implemented diagnostic commands: `/info` reports context size, the selected model and daily successful-request and token counters; `/workers` tests configured slots with real requests; owner-only `/server` gathers process and machine details, including CPU, memory, disks, network, uptime and available hardware information.
  • Deployed the bot and maintained it on my own Windows 10 server. Prepared `.env` configuration, prompt templates, Python virtual-environment setup, and setup, launch and stop scripts for Windows, macOS and Linux; configured Telegram updates through long polling without a public webhook or inbound port, with response generation through Cloudflare Workers AI.
  • Added automated checks for setup and safe reruns, Telegram failure handling, Cloudflare slot recovery and model-output cleanup. Wrote Russian and English documentation covering configuration, operation, diagnostics and maintenance.