create static method

Message create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "message",
  3. String special_return_type = "message",
  4. num? id,
  5. MessageSender? sender_id,
  6. num? chat_id,
  7. MessageSendingState? sending_state,
  8. MessageSchedulingState? scheduling_state,
  9. bool? is_outgoing,
  10. bool? is_pinned,
  11. bool? is_from_offline,
  12. bool? can_be_saved,
  13. bool? has_timestamped_media,
  14. bool? is_channel_post,
  15. bool? is_topic_message,
  16. bool? contains_unread_mention,
  17. num? date,
  18. num? edit_date,
  19. MessageForwardInfo? forward_info,
  20. MessageImportInfo? import_info,
  21. MessageInteractionInfo? interaction_info,
  22. List<UnreadReaction>? unread_reactions,
  23. FactCheck? fact_check,
  24. MessageReplyTo? reply_to,
  25. num? message_thread_id,
  26. num? saved_messages_topic_id,
  27. MessageSelfDestructType? self_destruct_type,
  28. double? self_destruct_in,
  29. double? auto_delete_in,
  30. num? via_bot_user_id,
  31. num? sender_business_bot_user_id,
  32. num? sender_boost_count,
  33. num? paid_message_star_count,
  34. String? author_signature,
  35. num? media_album_id,
  36. num? effect_id,
  37. bool? has_sensitive_content,
  38. String? restriction_reason,
  39. MessageContent? content,
  40. ReplyMarkup? reply_markup,
})
override

Generate By AZKADEV | Azka Axelion Gibran Script Dont edit by hand or anything manual

Implementation

static Message create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "message",
  String special_return_type = "message",
  num? id,
  MessageSender? sender_id,
  num? chat_id,
  MessageSendingState? sending_state,
  MessageSchedulingState? scheduling_state,
  bool? is_outgoing,
  bool? is_pinned,
  bool? is_from_offline,
  bool? can_be_saved,
  bool? has_timestamped_media,
  bool? is_channel_post,
  bool? is_topic_message,
  bool? contains_unread_mention,
  num? date,
  num? edit_date,
  MessageForwardInfo? forward_info,
  MessageImportInfo? import_info,
  MessageInteractionInfo? interaction_info,
  List<UnreadReaction>? unread_reactions,
  FactCheck? fact_check,
  MessageReplyTo? reply_to,
  num? message_thread_id,
  num? saved_messages_topic_id,
  MessageSelfDestructType? self_destruct_type,
  double? self_destruct_in,
  double? auto_delete_in,
  num? via_bot_user_id,
  num? sender_business_bot_user_id,
  num? sender_boost_count,
  num? paid_message_star_count,
  String? author_signature,
  num? media_album_id,
  num? effect_id,
  bool? has_sensitive_content,
  String? restriction_reason,
  MessageContent? content,
  ReplyMarkup? reply_markup,
}) {
  // Message message = Message({
  final Map message_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "id": id,
    "sender_id": (sender_id != null) ? sender_id.toJson() : null,
    "chat_id": chat_id,
    "sending_state": (sending_state != null) ? sending_state.toJson() : null,
    "scheduling_state": (scheduling_state != null) ? scheduling_state.toJson() : null,
    "is_outgoing": is_outgoing,
    "is_pinned": is_pinned,
    "is_from_offline": is_from_offline,
    "can_be_saved": can_be_saved,
    "has_timestamped_media": has_timestamped_media,
    "is_channel_post": is_channel_post,
    "is_topic_message": is_topic_message,
    "contains_unread_mention": contains_unread_mention,
    "date": date,
    "edit_date": edit_date,
    "forward_info": (forward_info != null) ? forward_info.toJson() : null,
    "import_info": (import_info != null) ? import_info.toJson() : null,
    "interaction_info": (interaction_info != null) ? interaction_info.toJson() : null,
    "unread_reactions": (unread_reactions != null) ? unread_reactions.toJson() : null,
    "fact_check": (fact_check != null) ? fact_check.toJson() : null,
    "reply_to": (reply_to != null) ? reply_to.toJson() : null,
    "message_thread_id": message_thread_id,
    "saved_messages_topic_id": saved_messages_topic_id,
    "self_destruct_type": (self_destruct_type != null) ? self_destruct_type.toJson() : null,
    "self_destruct_in": self_destruct_in,
    "auto_delete_in": auto_delete_in,
    "via_bot_user_id": via_bot_user_id,
    "sender_business_bot_user_id": sender_business_bot_user_id,
    "sender_boost_count": sender_boost_count,
    "paid_message_star_count": paid_message_star_count,
    "author_signature": author_signature,
    "media_album_id": media_album_id,
    "effect_id": effect_id,
    "has_sensitive_content": has_sensitive_content,
    "restriction_reason": restriction_reason,
    "content": (content != null) ? content.toJson() : null,
    "reply_markup": (reply_markup != null) ? reply_markup.toJson() : null,
  };

  message_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (message_data_create_json.containsKey(key) == false) {
        message_data_create_json[key] = value;
      }
    });
  }
  return Message(message_data_create_json);
}