Skip to content
Alfonso² Peterssen edited this page Jul 30, 2017 · 2 revisions

Hosting Telegram bots on Heroku is uber-easy, their free tier is awesome for testing and hosting personal bots; you can also turbocharge your bot; in case of sudden popularity.

Add sbt-heroku and sbt-native-packager to your project/plugins.sbt.

To register your bot and get a token, please follow the the official Telegram guide.

Setup

Create a Heroku account and install the Heroku CLI for your platform. Arch users can install nodejs-heroku-cli from the AUR.

Git is the preferred way to manage your, if you are starting from scratch just run on your project folder.

git init # Optional, if starting from scratch

heroku login # To set your credentials
heroku create # app will be called something like frozen-beach-52718
heroku git:remote -a heroku-appname-12345 # Use the app name from the previous command

Configuration

Run the following commands to provide your bot with a token and the webhook URL.
heroku config:set BOT_TOKEN=PASTE_YOUR_TOKEN_HERE
heroku config:set WEBHOOK_URL=$(heroku info -s | grep web_url | cut -d= -f2)

Deploy

sbt stage deployHeroku

Clone this wiki locally