Created
April 17, 2020 17:00
-
-
Save alages97/af6b92f6d54192ffb79ad3658576aa38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@server.route('/' + TOKEN, methods=['POST']) | |
def getMessage(): | |
bot.process_new_updates([telebot.types.Update.de_json(request.stream.read().decode("utf-8"))]) | |
return "!", 200 | |
@server.route("/") | |
def webhook(): | |
bot.remove_webhook() | |
bot.set_webhook(url='https://<insert heroku app name here>.herokuapp.com/' + TOKEN) | |
return "!", 200 | |
if __name__ == "__main__": | |
server.run(host="0.0.0.0", port=int(os.environ.get('PORT', 5000))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment