create static method
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,
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);
}