By the end of this lesson your bot will run on a server that never sleeps, receive messages by webhook with a secret check, keep its orders in a hosted database, and send the 11 AM reminder without your laptop.
You need: the bot from lesson 3, a free Cloudflare account (or another host from the table below), your coding agent · Time: 9 minutes
Right now the bot lives on your laptop. Close the lid, lose Wi-Fi or let Windows restart for an update, and the program stops. Telegram keeps new messages for up to 24 hours, then drops them. Customers see a bot that does not answer, and the 11 AM reminder never goes out.
For a business bot you need a host: a computer in a data centre that runs your code all day, every day.
Why?Mrs. Sharma's customers order at 10 PM and 7 AM, not when your laptop happens to be open. A bot that answers only sometimes is worse than no bot: people stop trusting it.
Log in free to read the rest of this lesson
Every lesson is free. A free account unlocks all of them and saves your progress.
Still to come in this lesson:
- Polling vs webhook, for Telegram
- Choose a home for the bot
- Move the bot online with one prompt
- Check the webhook with getWebhookInfo
- Recap