A simple viber bot created in python3 and deployed in heroku container.
- Login to Viber Partners and create Bot Account. Check for Token in Account Info.
git@github.com:wannamit/viberbot-chuck.git
andcd viberbot-chuck
- Install Heroku
- Setup Heroku account
- Login Heroku
- Create new pipeline (No need to connect to github)
- Create new app (app name required later)
- Replace 4 strings in
viberChuckBot.py
MY_BOT_NAME
=> Name of your Bot AccountMY_IMAGE_URL
=> URL of your Bot Acccount ImageMY_APP_TOKEN
=> Bot Account Token provided in Account InfoHEROKU_APP_URL
=> https://<heroku_app_name>.herokuapp.com
- Login Heroku in local Terminal
heroku login
- Install Docker Help
- Pull python image used here
docker pull python:3-alpine3.7
- Heroku Container Login
heroku container:login
- Create docker image and push to heroku
heroku container:push web -a <heroku_app_name>
(keep the nameweb
) - Release pushed docker image
heroku container:release web -a <heroku_app_name>
- Open Heroku App's > Resources > Change Dyno Type > Turn ON
web
dyno - Scale
web
dynoheroku ps:scale web=1 -a <heroku_app_name>
- Open app (Top right of Heroku App page). Should reply "Viber bot that gives Chuck Norris joke as reply of each message."
- To check Heroku server logs
heroku logs --tail -a <heroku_app_name>
- Check your Public Account Viber Bot in Viber; It should now have option to send message.
- Send any message to bot and it will reply with random Chuck Norris Facts
- An example here