In this video we see how to create a Telegram Bot in python using nginx and Google Cloud Platform.
UPDATE! There was a change in the library, so please use the following for the webhook:
def tbot():
updater = Updater(TOKEN, use_context=True)
dp = updater.dispatcher
dp.add_handler(CommandHandler("help", htel))
dp.add_handler(MessageHandler(Filters.text, echo))
updater.start_webhook(
listen="0.0.0.0",
port=5000,
url_path=TOKEN,
webhook_url=f'https://{SERVER}{TOKEN}',
cert=CERT)
updater.idle()
You can see the changes here: https://github.com/python-telegram-bot/python-telegram-bot/wiki/Webhooks#the-integrated-webhook-server
Medium article: https://medium.com/@jasonjurotich/how-to-create-a-simple-telegram-bot-in-python-using-nginx-and-gcp-926f1b0fb16f
Download
0 formats
No download links available.
HOW TO CREATE A TELEGRAM BOT WITH PYTHON, NGINX AND GOOGLE CLOUD PLATFORM | NatokHD