pyTelegramBotApi не обрабатывает Update

Сделал вебхук все запросы точно присылаются, но сам update не обрабатывается

bot = telebot.TeleBot(config.tg_bot_token)


@app.route(WEBHOOK_URL_PATH, methods=['POST'])
def webhook():
    print("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)
        print(update)
        bot.process_new_updates([update])
        return ''
    else:
        flask.abort(403)


@bot.message_handler(commands=['start'])
def send_auth_tg(message: telebot.types.Message):
    print("start")
    if message.chat.id != config.admin_chat_id:
        bot.send_message(chat_id=message.chat.id, text=f"Здравствуйте! Нет доступа к боту")
    else:
        with app.app_context():
            helper = get_helper_by_tg_chat_id(tg_chat_id=message.chat.id)
            if helper is None:
                helper = authorize_new_helper(telegram_chat_id=message.chat.id)
        bot.send_message(chat_id=message.chat.id, text=f"Здравствуйте! Вы были авторизированы")

Запросы приходят но при bot.process_new_updates([update]) ничего не происходит. Что делать?


Ответы (0 шт):