copyWith method

SendMessage copyWith({
  1. int? chatId,
  2. MessageTopic? topicId()?,
  3. InputMessageReplyTo? replyTo()?,
  4. MessageSendOptions? options()?,
  5. ReplyMarkup? replyMarkup()?,
  6. InputMessageContent? inputMessageContent,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

SendMessage copyWith({
  int? chatId,
  MessageTopic? Function()? topicId,
  InputMessageReplyTo? Function()? replyTo,
  MessageSendOptions? Function()? options,
  ReplyMarkup? Function()? replyMarkup,
  InputMessageContent? inputMessageContent,
}) => SendMessage(
  chatId: chatId ?? this.chatId,
  topicId: topicId != null ? topicId() : this.topicId,
  replyTo: replyTo != null ? replyTo() : this.replyTo,
  options: options != null ? options() : this.options,
  replyMarkup: replyMarkup != null ? replyMarkup() : this.replyMarkup,
  inputMessageContent: inputMessageContent ?? this.inputMessageContent,
);