answerWebAppQuery method

Future<SentWebAppMessage> answerWebAppQuery(
  1. String webAppQueryId,
  2. InlineQueryResult result
)

Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated.

On success, a SentWebAppMessage object is returned.

https://core.telegram.org/bots/api#answerwebappquery

Implementation

Future<SentWebAppMessage> answerWebAppQuery(
    String webAppQueryId, InlineQueryResult result) async {
  var requestUrl = _apiUri('answerWebAppQuery');
  var body = <String, dynamic>{
    'web_app_query_id': webAppQueryId,
    'result': jsonEncode(result),
  };
  return await HttpClient.httpPost(requestUrl, body: body);
}