editMessageText method

Future<Map> editMessageText({
  1. dynamic chat_id,
  2. dynamic message_id,
  3. dynamic inline_message_id,
  4. required String text,
  5. String? parse_mode = "html",
  6. List? entities,
  7. bool? disable_web_page_preview = false,
  8. Map? reply_markup,
  9. required int clientId,
  10. String? extra,
  11. bool? isUseCache,
  12. Duration? durationCacheExpire,
})

editMessage text return result

{

}

Implementation

Future<Map> editMessageText({
  dynamic chat_id,
  dynamic message_id,
  dynamic inline_message_id,
  required String text,
  String? parse_mode = "html",
  List? entities,
  bool? disable_web_page_preview = false,
  Map? reply_markup,
  required int clientId,
  String? extra,
  bool? isUseCache,
  Duration? durationCacheExpire,
}) async {
  entities ??= [];
  var pesan = parseMode(text, parse_mode, entities);
  if (inline_message_id is String && inline_message_id.isNotEmpty) {
    return await invoke(
      "editInlineMessageText",
      parameters: {
        "inline_message_id": inline_message_id,
        "reply_markup": replyMarkup(reply_markup),
        "input_message_content": {
          '@type': "inputMessageText",
          "text": pesan,
          "disable_web_page_preview": disable_web_page_preview,
          "clear_draft": false,
        }
      },
      isUseCache: isUseCache,
      durationCacheExpire: durationCacheExpire,
      clientId: clientId,
      extra: extra,
    );
  } else {
    return await invoke(
      "editMessageText",
      parameters: {
        "chat_id": chat_id,
        "message_id": message_id,
        "reply_markup": replyMarkup(reply_markup),
        "input_message_content": {
          '@type': "inputMessageText",
          "text": pesan,
          "disable_web_page_preview": disable_web_page_preview,
          "clear_draft": false,
        }
      },
      isUseCache: isUseCache,
      durationCacheExpire: durationCacheExpire,
      clientId: clientId,
      extra: extra,
    );
  }
}