Hello. I'm followed your example building a simple Telegram bot. It's working fine.
Than i'd like to make a bot using pyTelegramBotAPI. And it doesn't work — i don't have answers from my bot. I tried different exemples, not only using pyTelegramBotAPI (e.g. this one) all of them don't work.
So, my question is how to make working something like that code (from this example):
@app.route(WEBHOOK_URL_PATH, methods=['POST'])
def webhook():
if flask.request.headers.get('content-type') == 'application/json':
json_string = flask.request.get_data().decode('utf-8')
update = telebot.types.Update.de_json(json_string)
bot.process_new_updates([update])
return ''
else:
flask.abort(403)
@bot.message_handler(commands=['help', 'start'])
def send_welcome(message):
bot.reply_to(message,
("Hi there, I am EchoBot.\n"
"I am here to echo your kind words back to you."))
using Flask in PythonAnywhere?
Is it possible?
Thanks.