sendChecklist method

Future<Message> sendChecklist(
  1. String businessConnectionId,
  2. ID chatId,
  3. InputChecklist checklist, {
  4. bool? disableNotification,
  5. bool? protectContent,
  6. String? messageEffectId,
  7. ReplyParameters? replyParameters,
  8. InlineKeyboardMarkup? replyMarkup,
})

Sends a checklist on behalf of a connected business account.

See: https://core.telegram.org/bots/api#sendchecklist

Returns the sent Message.

Implementation

Future<Message> sendChecklist(
  String businessConnectionId,
  ID chatId,
  InputChecklist checklist, {
  bool? disableNotification,
  bool? protectContent,
  String? messageEffectId,
  ReplyParameters? replyParameters,
  InlineKeyboardMarkup? replyMarkup,
}) async {
  final params = <String, dynamic>{
    'business_connection_id': businessConnectionId,
    'chat_id': chatId,
    'checklist': checklist,
    'disable_notification': ?disableNotification,
    'protect_content': ?protectContent,
    'message_effect_id': ?messageEffectId,
    'reply_parameters': ?replyParameters,
    'reply_markup': ?replyMarkup,
  };

  final payload = Payload(params);
  final response = await _makeRequest<Map<String, dynamic>>(
    APIMethod.sendChecklist.name,
    payload,
  );

  return Message.fromJson(response);
}