yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.31k stars 1.51k forks source link

Method answerWebAppQuery call request with type answerCallbackQuery #971

Closed r1ddev closed 2 years ago

r1ddev commented 2 years ago

Bug Report

Actual Behavior

answerWebAppQuery function not works propertly, telegram send error: "400 Bad Request: query is too old and response timeout expired or query ID is invalid". In answerWebAppQuery function (telegram.js:1482) actually requested type answerCallbackQuery. So the function answerWebAppQuery is not working.

Expected Behavior

Function answerWebAppQuery must send type answerWebAppQuery.

Example

Just replace it to answerWebAppQuery and all will works fine.

answerWebAppQuery(webAppQueryId, result, form = {}) {
    form.web_app_query_id = webAppQueryId;
    form.result = stringify(result);
    return this._request('answerWebAppQuery', { form });
  }
theexplay commented 2 years ago

any updates? answerWebAppQuery api doesn't work cause of this problem

starseedamm commented 2 years ago

The answer to the problem described looks to be noted above. Problem: "Function answerWebAppQuery must send type answerWebAppQuery." but function (telegram.js:1482) actually requested type answerCallbackQuery Solution: "Just replace it to answerWebAppQuery and all will works fine."

danielperez9430 commented 2 years ago

Fix in the new version v0.58.0