Student projects
Host a Telegram bot 24/7
A Telegram bot on long polling has to keep asking the Telegram API for updates, which is a process that runs forever rather than one that answers a request and stops. Awake keeps it running continuously, and restarts it on its own if it crashes.
What you get.
Host a Telegram bot that never sleeps, from ₹249 a month.
How it fits
- node-telegram-bot-api, python-telegram-bot, Telegraf, or your own polling loop
- A webhook bot works too: it answers a real HTTPS address we give it
- Awake never sleeps, so long polling never has a gap where updates are missed
- Crashes restart the process automatically, on the same machine, with the same environment
- A database on the same machine for chat state, user data or anything else the bot needs to keep
Deploy it, step by step
The dashboard flow is the same for every project:
- Sign in with GitHub. Go to the dashboard and sign in. Your first sign-in puts 30 days of Nap credit in your balance, with no card and nothing to cancel.
- Create an application. Press New app and give it a name: three characters or more, letters, numbers and hyphens. The address is shown under the field as you type, and it is yourapp-yourlogin.dormhost.app.
- Pick the plan. Nap sleeps when nobody is using it. Awake never sleeps, which is what a bot, a worker or a scheduled job needs. Either way, you choose Mumbai, London or Ashburn.
- Point it at your repository. Paste the GitHub URL and the branch. Press Connect GitHub to pick from a list instead, which is also how a private repository is deployed. Then press Create and deploy.
- Watch the build log. The application opens on Overview, and Live logs streams the build. Listen on the port in the PORT variable we set, or EXPOSE one port in your Dockerfile, and the address answers as soon as the build finishes.
What is different about Telegram bot
- Push the bot to GitHub. Node.js and Python are detected and built automatically; anything else needs a Dockerfile.
- Create the app on Awake, not Nap. A polling bot with nobody visiting it over HTTP looks idle to Nap and would be put to sleep.
- Put the bot token in the Environment section, never in the repository, and read it from the environment in code.
- On long polling there is nothing to bind to PORT; a webhook bot should bind to it and use the app's address as the webhook URL.
- Watch Live logs after the first deploy to confirm it is receiving updates.
This needs Awake, ₹249 a month: it has to stay running, and Nap would put it to sleep after 15 minutes idle. All in: the build, the process, the database and the storage, nothing metered separately. Start with 30 days of free credit, no card required. The docs cover databases, domains and what to do when a build fails.