I just learned about Vibe Coding.
Basically, you use AI to code for you using natural language. In simpler terms, you can describe the functions you want for a program, and AI writes the code for you.
You can write a small function or program for you (i.e. write an app).
If you search for it on the net, you will be reminded that a good underlying knowledge about what’s written is still needed, should you write something more complicated (multifunctional).
I have been vibe coding for a good 2 years on free accounts. My fave platform is CoPilot and yes you definitely still need to have a working knowledge on what’s going on in your codes. Imagine building a house and you wish to add a room but you don’t know how to make that work with the existing structure especially if you never build any kinds of structure before. That’s how it is.
The key to building a full app via vibe coding is to determine a clear modular structure of what the app is going to be, that way, expansion will be more tolerable. So far I’ve tried that on web building and Telegram bots so don’t try this to create a more complicated program. 😵💫
Let’s see what it looks like with a simple prompt in CoPilot.
Prompt: Create from scratch. I need a telegram bot that helps to send me random 4 digits upon request.
Got it 👍 — let’s build a simple Telegram bot from scratch that sends you a random 4‑digit number whenever you ask for it. I’ll walk you through the steps and give you the code.
---
## 🛠 Steps to Create the Bot
1. **Create a bot on Telegram**
- Open Telegram and search for **BotFather**.
- Start a chat and run `/newbot`.
- Give your bot a name and a username (must end with `bot`).
- BotFather will give you a **token** (something like `123456789:ABC-XYZ...`). Save this — you’ll need it in the code.
2. **Set up your environment**
- Install Python (3.8+ recommended).
- Install the `python-telegram-bot` library:
```bash
pip install python-telegram-bot==13.15
```
3. **Write the bot code**
Here’s a minimal working example:
```python
import logging
import random
from telegram.ext import Updater, CommandHandler
# Enable logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO
)
logger = logging.getLogger(__name__)
# Command handler for /random
def random_digits(update, context):
number = random.randint(1000, 9999) # Generate random 4-digit number
update.message.reply_text(f"Your random 4-digit number: {number}")
def main():
# Replace with your BotFather token
TOKEN = "YOUR_TELEGRAM_BOT_TOKEN"
updater = Updater(TOKEN, use_context=True)
dp = updater.dispatcher
# Add command handler
dp.add_handler(CommandHandler("random", random_digits))
# Start the bot
updater.start_polling()
updater.idle()
if __name__ == '__main__':
main()
```
4. **Run the bot**
- Save the file as `bot.py`.
- Run it:
```bash
python bot.py
```
- Go to your bot on Telegram and type `/random`. It will reply with a random 4‑digit number.
---
## 🚀 Extra Ideas
- Add `/start` command to greet you.
- Allow `/random N` to generate N random numbers.
- Deploy it on a server (Heroku, AWS, or even a Raspberry Pi) so it’s always online.
---
Would you like me to extend this bot so it can also **send you a random 4‑digit number automatically at a set time each day**, or keep it strictly on-demand with `/random`?
Most importantly, you need to really anticipate what your app is going to need. Experience definitely counts in this case. Perhaps my biggest hurdle was debugging. Since I’m just a casual coder there were some things that I didn’t anticipate as the apps I was building started to take (bigger) shape. You’ll end up rebuilding an entire section just to make basic things work.
Case in point, when I was building a Telegram bot, I began with a direct flow (prompt/click -> execute) but I wasn’t expecting a stepped flow (prompt/click -> prompted response (as many as you need) -> execute). So I had to strip off everything in the core files. To make matters worse, AI will drift away from the anchor topic as you add more questions, so there’s another challenge.
For a casual coder, I definitely learned many new (and updated) things while vibe coding.
Leave a Reply