banner



How To Reopen Your Heroku App To Add Changes

How to Deploy a Telegram Bot using Heroku for Gratuitous

A Complete Guide Using the python-telegram-bot Library

Haohui

Photo past Ian Battaglia on Unsplash

Modifying the python-telegram-bot script

Changing from Polling to Webhooks

Paradigm taken from https://community.stuart.engineering science/t/webhooks-vs-polling/257

Image taken from https://customs.stuart.technology/t/webhooks-vs-polling/257
          import os
PORT = int(bone.environ.get('PORT', 5000))
          updater.start_polling()        
          updater.start_webhook(heed="0.0.0.0",
port=int(PORT),
url_path=TOKEN)
updater.bot.setWebhook('https://yourherokuappname.herokuapp.com/' + TOKEN)

Creating your Heroku Webapp — Setting upwards the Directory

          bot.py
Procfile
requirements.txt
          python-telegram-bot==12.7        
          web: python3 bot.py        

Creating your Heroku Webapp

          heroku login        

          heroku create        
          updater.bot.setWebhook('https://yourherokuappname.herokuapp.com/' + TOKEN)        
          git init
git add together .
git commit -m "first commit"
heroku git:remote -a YourAppName
git button heroku main

What to do if your Bot stops responding

          git add .
git commit -m "changing python3 to python in Procfile"
git push heroku master

Source: https://towardsdatascience.com/how-to-deploy-a-telegram-bot-using-heroku-for-free-9436f89575d2

Posted by: majorreeld1968.blogspot.com

0 Response to "How To Reopen Your Heroku App To Add Changes"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel