answerCallbackQuery method

Future<Map> answerCallbackQuery(
  1. dynamic callback_query_id, {
  2. String? text,
  3. bool show_alert = false,
  4. String? url,
  5. int? cache_time,
  6. required int clientId,
  7. String? extra,
  8. bool? isUseCache,
  9. Duration? durationCacheExpire,
})

answerCallbackQuery for bot only

Implementation

Future<Map> answerCallbackQuery(
  callback_query_id, {
  String? text,
  bool show_alert = false,
  String? url,
  int? cache_time,
  required int clientId,
  String? extra,
  bool? isUseCache,
  Duration? durationCacheExpire,
}) async {
  Map<String, dynamic> data = {
    "callback_query_id": callback_query_id,
  };

  if (text != null) {
    data["text"] = text;
  }
  data["show_alert"] = show_alert;

  if (url != null) {
    data["url"] = url;
  }

  if (cache_time != null) {
    data["cache_time"] = cache_time;
  }

  return await invoke(
    "answerCallbackQuery",
    parameters: data,
    clientId: clientId,
    extra: extra,
    isUseCache: isUseCache,
    durationCacheExpire: durationCacheExpire,
  );
}