I’ve built a lot of bots but never for Telegram. And never with AI.
I joined the hackathon to fix that.
I wanted to push beyond my comfort zone in Python, and finally explore how hard (or easy?) it really is to build a fully working Telegram bot, one that doesn’t just echo messages, but helps with something practical: creating and editing content for Telegram itself.
I chose the AI + content theme for a reason:
We scroll past hundreds of Telegram posts daily, but what if AI could write, clean up, or even repurpose them right inside the chat?
This is how the idea for my Gemini-powered Telegram assistant was born.
Table of Contents
- Getting Started with Bolt.new
- What the AI Generated and How It Felt
- New Ideas Sparked by the First Prototype
- Can AI Really Help Refine Code?
- Final Thoughts: What I Learned Using Bolt
- Bonus: Why You Should Try It Too
Getting Started with Bolt.new
I started the project on Bolt.new - an AI-powered coding environment. After signing in, I was dropped into a minimal interface with a chat window.
Bolt includes a full library of built-in prompt templates ranging from SEO audits and accessibility checks to API documentation generators. But none of them quite matched what I needed.
There were great options like:
- Accessible Data Tables
- Internationalization Setup
- Dark Mode Implementation
- API Documentation Generator
But no prompt for building a Telegram bot with an AI brain. So I went freestyle.
I typed out my own custom request (unfortunately I didn’t save the exact wording), but it was roughly along the lines of:
"Create a Telegram bot in Python that can help users create and edit Telegram posts using Gemini."
Then came the model selection. I used Gemini 2.0 Flash, which is fast, reasonably smart for structured tasks, and (most importantly) gives up to 1,500 requests per day on the free tier (at the time of writing). That was enough to prototype without running into hard stops… most of the time.
To connect to Gemini API manually outside Bolt, I used the google-generativeai Python library.
What the AI Generated and How It Felt
Bolt didn’t just write a few lines, it generated:
- A working Telegram bot skeleton
- Clear separation between message handling and AI logic
- Proper dependencies, imports, and basic config structure
At first, the bot accepted raw text and returned improved versions of Telegram posts - enhancing structure, readability, and engagement. It corrected grammar, spelling, and punctuation, shortened or expanded content as needed, and even provided suggestions for improvement.
Pretty quickly, I asked it to go further and refine the prompt logic, modularize the code, and add additional commands.
But there were limits.
When I didn't specify the desired architecture, the AI would dump everything into a single monolithic script. When I did ask for modular code, it generated better folder structure and helper functions but at the cost of increased token usage. And yes, I hit credit limits, which meant I had to finish parts of the logic manually.
Still, the first time I ran the bot and saw it respond inside Telegram - something clicked.
It was surprisingly satisfying to have a functional AI-enhanced project up and running in just minutes.
New Ideas Sparked by the First Prototype
Once the basic bot was working, ideas started flowing.
Seeing how fast AI could help clean up and rewrite Telegram posts, I realized the tool could go beyond just editing. It could actually manage the full publishing workflow.
Here’s what I started thinking about next:
- Post publishing. Allow the bot to not just prepare content, but also publish directly to a Telegram channel or group via the Telegram Bot API.
- Localization. Add multilingual support.
- Token/length management. Telegram has limits on message size, so it made sense to add auto-trimming or content chunking to stay within platform rules.
- Pre-publish editing. Before final posting, offer a preview and allow the user to make last-minute manual edits inside the chat.
What started as a simple content editor began to feel more like a personal Telegram content assistant and that opened up a lot of potential for future work.
Can AI Really Help Refine Code?
Absolutely, but with caution. Bolt proved to be genuinely helpful. In short bursts, AI can feel like pair programming with someone who never gets tired. But it’s not bulletproof.
“Hallucinations” (weird or buggy code suggestions) usually crept in when I asked for large changes without enough tokens left. That led to incomplete functions, broken imports, or inconsistent naming across files.
The more specific and scoped the prompt, the better the result.
The more vague or overloaded the task, the more likely it would generate something broken or just... strange.
So:
Can you use AI to build a production-ready bot?
Yes, as long as you treat the AI as a tool, not a team.
Always review, test, and fill in the gaps manually.
For me, Bolt was a solid jumpstart engine, but not a hands-free autopilot.
Final Thoughts: What I Learned Using Bolt
This hackathon helped me push beyond the “idea stage” - I expanded my Python stack, built my first real Telegram bot, and got hands-on with the Gemini API.
Would I recommend Bolt to others? Yes, especially for early-stage prototyping, solo projects, or learning AI-assisted workflows. It’s fast, beginner-friendly, and surprisingly capable when given clear instructions.
That said, for polishing and scaling production-grade tools, I’d probably pair it with another AI or switch to a full IDE. Bolt shines when you want to test, sketch, and explore ideas, not necessarily when debugging edge cases or optimizing architecture.
Bonus: Why You Should Try It Too
If you’ve been putting off your “Telegram bot idea” because it sounds like too much work, I get it. But tools like Bolt can get you to a working MVP much faster than you'd expect. In my case, I saved hours of setup, wiring, and boilerplate.
To be honest, if I had done everything manually with aiogram, it would’ve taken at least twice as long, just to get to the same functional baseline.
Instead, I had:
- A working bot prototype in under an hour
- Cleanly structured code (with a few edits)
- Gemini integration up and running with minimal friction
The bot is still a work in progress, but it’s live on GitHub if you want to try it, fork it, or improve it:
I’m planning to host it soon and turn it into a proper content assistant for Telegram creators.
If you're exploring something similar or just want to collaborate, I’d love to hear from you.
This project was built as part of a hackathon by @oleg_pydev and @valentina_skakun.
Top comments (0)