copyWith method
Message
copyWith({
- int? id,
- MessageSender? senderId,
- int? chatId,
- MessageSendingState? sendingState()?,
- MessageSchedulingState? schedulingState()?,
- bool? isOutgoing,
- bool? isPinned,
- bool? canBeEdited,
- bool? canBeForwarded,
- bool? canBeRepliedInAnotherChat,
- bool? canBeSaved,
- bool? canBeDeletedOnlyForSelf,
- bool? canBeDeletedForAllUsers,
- bool? canGetAddedReactions,
- bool? canGetStatistics,
- bool? canGetMessageThread,
- bool? canGetReadDate,
- bool? canGetViewers,
- bool? canGetMediaTimestampLinks,
- bool? canReportReactions,
- bool? hasTimestampedMedia,
- bool? isChannelPost,
- bool? isTopicMessage,
- bool? containsUnreadMention,
- int? date,
- int? editDate,
- MessageForwardInfo? forwardInfo()?,
- MessageImportInfo? importInfo()?,
- MessageInteractionInfo? interactionInfo()?,
- List<
UnreadReaction> ? unreadReactions, - MessageReplyTo? replyTo()?,
- int? messageThreadId,
- int? savedMessagesTopicId,
- MessageSelfDestructType? selfDestructType()?,
- double? selfDestructIn,
- double? autoDeleteIn,
- int? viaBotUserId,
- int? senderBoostCount,
- String? authorSignature,
- int? mediaAlbumId,
- String? restrictionReason,
- MessageContent? content,
- ReplyMarkup? replyMarkup()?,
- dynamic extra,
- int? clientId,
Returns a copy with the given fields replaced. For a nullable
field pass a function, e.g. field: () => null to clear it.
Implementation
Message copyWith({
int? id,
MessageSender? senderId,
int? chatId,
MessageSendingState? Function()? sendingState,
MessageSchedulingState? Function()? schedulingState,
bool? isOutgoing,
bool? isPinned,
bool? canBeEdited,
bool? canBeForwarded,
bool? canBeRepliedInAnotherChat,
bool? canBeSaved,
bool? canBeDeletedOnlyForSelf,
bool? canBeDeletedForAllUsers,
bool? canGetAddedReactions,
bool? canGetStatistics,
bool? canGetMessageThread,
bool? canGetReadDate,
bool? canGetViewers,
bool? canGetMediaTimestampLinks,
bool? canReportReactions,
bool? hasTimestampedMedia,
bool? isChannelPost,
bool? isTopicMessage,
bool? containsUnreadMention,
int? date,
int? editDate,
MessageForwardInfo? Function()? forwardInfo,
MessageImportInfo? Function()? importInfo,
MessageInteractionInfo? Function()? interactionInfo,
List<UnreadReaction>? unreadReactions,
MessageReplyTo? Function()? replyTo,
int? messageThreadId,
int? savedMessagesTopicId,
MessageSelfDestructType? Function()? selfDestructType,
double? selfDestructIn,
double? autoDeleteIn,
int? viaBotUserId,
int? senderBoostCount,
String? authorSignature,
int? mediaAlbumId,
String? restrictionReason,
MessageContent? content,
ReplyMarkup? Function()? replyMarkup,
dynamic extra,
int? clientId,
}) =>
Message(
id: id ?? this.id,
senderId: senderId ?? this.senderId,
chatId: chatId ?? this.chatId,
sendingState: sendingState != null ? sendingState() : this.sendingState,
schedulingState:
schedulingState != null ? schedulingState() : this.schedulingState,
isOutgoing: isOutgoing ?? this.isOutgoing,
isPinned: isPinned ?? this.isPinned,
canBeEdited: canBeEdited ?? this.canBeEdited,
canBeForwarded: canBeForwarded ?? this.canBeForwarded,
canBeRepliedInAnotherChat:
canBeRepliedInAnotherChat ?? this.canBeRepliedInAnotherChat,
canBeSaved: canBeSaved ?? this.canBeSaved,
canBeDeletedOnlyForSelf:
canBeDeletedOnlyForSelf ?? this.canBeDeletedOnlyForSelf,
canBeDeletedForAllUsers:
canBeDeletedForAllUsers ?? this.canBeDeletedForAllUsers,
canGetAddedReactions: canGetAddedReactions ?? this.canGetAddedReactions,
canGetStatistics: canGetStatistics ?? this.canGetStatistics,
canGetMessageThread: canGetMessageThread ?? this.canGetMessageThread,
canGetReadDate: canGetReadDate ?? this.canGetReadDate,
canGetViewers: canGetViewers ?? this.canGetViewers,
canGetMediaTimestampLinks:
canGetMediaTimestampLinks ?? this.canGetMediaTimestampLinks,
canReportReactions: canReportReactions ?? this.canReportReactions,
hasTimestampedMedia: hasTimestampedMedia ?? this.hasTimestampedMedia,
isChannelPost: isChannelPost ?? this.isChannelPost,
isTopicMessage: isTopicMessage ?? this.isTopicMessage,
containsUnreadMention:
containsUnreadMention ?? this.containsUnreadMention,
date: date ?? this.date,
editDate: editDate ?? this.editDate,
forwardInfo: forwardInfo != null ? forwardInfo() : this.forwardInfo,
importInfo: importInfo != null ? importInfo() : this.importInfo,
interactionInfo:
interactionInfo != null ? interactionInfo() : this.interactionInfo,
unreadReactions: unreadReactions ?? this.unreadReactions,
replyTo: replyTo != null ? replyTo() : this.replyTo,
messageThreadId: messageThreadId ?? this.messageThreadId,
savedMessagesTopicId: savedMessagesTopicId ?? this.savedMessagesTopicId,
selfDestructType: selfDestructType != null
? selfDestructType()
: this.selfDestructType,
selfDestructIn: selfDestructIn ?? this.selfDestructIn,
autoDeleteIn: autoDeleteIn ?? this.autoDeleteIn,
viaBotUserId: viaBotUserId ?? this.viaBotUserId,
senderBoostCount: senderBoostCount ?? this.senderBoostCount,
authorSignature: authorSignature ?? this.authorSignature,
mediaAlbumId: mediaAlbumId ?? this.mediaAlbumId,
restrictionReason: restrictionReason ?? this.restrictionReason,
content: content ?? this.content,
replyMarkup: replyMarkup != null ? replyMarkup() : this.replyMarkup,
extra: extra ?? this.extra,
clientId: clientId ?? this.clientId,
);