/viberbot-chuck

A simple viber bot created in python3 and deployed in heroku.

Primary LanguagePython

About

A simple viber bot created in python3 and deployed in heroku container.

Usage

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