Your First Bot¶
Let's get something working on Telegram in the next few minutes. No JavaScript logic, no databases, no complex structures—just a bot that says hello when someone sends /start.
Spoiler: If you can fill in two fields in a dashboard and click "Save", you can build a bot. That is literally all we are doing here!
Step 1: Open the Command Editor¶
First, navigate to your bot project in the dashboard:
- Open the TeleBotHost Console.
- Click on your bot from the dashboard list.
- Open the Commands tab.
- Click Add Command.
Step 2: Fill in the Fields¶
You will see a form with several fields. For now, we only care about two:
- Command: Type
/start(This is the message users send when they first interact with your bot). - Answer: Type your greeting message, for example:
Click Save Command at the bottom of the form.
Step 3: Turn It On!¶
Before testing, make sure your bot is online:
- Look at the top right of your bot's management panel.
- If it says Offline, click the Launch Bot button.
- Wait a second until the status indicator turns green (Online).
Step 4: Test Your Bot!¶
Let's see it in action:
- Open Telegram on your phone or computer.
- Search for your bot's username (the one you set up with
@BotFather). - Open the chat and click the Start button at the bottom (or type
/startmanually and send it). - Boom! Your bot will reply instantly with your greeting.
🎉 You are officially a bot creator!
How does this work under the hood?¶
When someone sends /start to your bot:
- Telegram sends the message data (called an update) to TeleBotHost.
- TeleBotHost searches your command list, finds the
/startcommand, and immediately sends the text in your Answer field back to the chat. - The flow ends. Simple and fast!
What's Next?¶
Tapping buttons is way cooler than typing commands. In the next step, we'll add reply buttons below the chat input!