Weebhook on heroku dont working
After deploying on heroku bot don't answer. Was trying as in example with flask.
- What version of pyTelegramBotAPI are you using? pyTelegramBotAPI==3.2.1
- What OS are you using? osx
- What version of python are you using? last one Its looks like all is ok, but bot is't responding. My code:
import os
import telebot
from flask import Flask, request
token = os.environ['TELEGRAM_TOKEN']
bot = telebot.TeleBot(token)
server = Flask(__name__)
#hadlers
#and in the end
@server.route("/", 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.com//somename.herokuapp.com/bot")
return "!", 200
server.run(host="0.0.0.0", port=int(os.environ.get('PORT', 5000)))
server = Flask(__name__)
In the console on heroku I have: Running on http://0.0.0.0:16845/ (Press CTRL+C to quit)
@WTFisThat1 I have the same error. I'm looking for a solution. We are waiting for the answer from the developer.
Dose your getMessage() method receive any request?
@eternnoir
@bot.message_handler(func=lambda message: True)
def delete_massage_user(message):
bot.delete_message(message.chat.id, message.message_id)
At me here such method. Deletes all incoming messages in the supergroup. But it's not that. And the fact that the bot does not even run on Heroku.
@WTFisThat1 you have not valid address in the set_webhook https.com//somename.herokuapp.com/bot and check getWebhookinfo