copyWith method

MessageSendOptions copyWith({
  1. InputSuggestedPostInfo? suggestedPostInfo()?,
  2. bool? disableNotification,
  3. bool? fromBackground,
  4. bool? protectContent,
  5. bool? allowPaidBroadcast,
  6. int? paidMessageStarCount,
  7. bool? updateOrderOfInstalledStickerSets,
  8. MessageSchedulingState? schedulingState()?,
  9. int? effectId,
  10. int? sendingId,
  11. bool? onlyPreview,
})

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

Implementation

MessageSendOptions copyWith({
  InputSuggestedPostInfo? Function()? suggestedPostInfo,
  bool? disableNotification,
  bool? fromBackground,
  bool? protectContent,
  bool? allowPaidBroadcast,
  int? paidMessageStarCount,
  bool? updateOrderOfInstalledStickerSets,
  MessageSchedulingState? Function()? schedulingState,
  int? effectId,
  int? sendingId,
  bool? onlyPreview,
}) => MessageSendOptions(
  suggestedPostInfo: suggestedPostInfo != null
      ? suggestedPostInfo()
      : this.suggestedPostInfo,
  disableNotification: disableNotification ?? this.disableNotification,
  fromBackground: fromBackground ?? this.fromBackground,
  protectContent: protectContent ?? this.protectContent,
  allowPaidBroadcast: allowPaidBroadcast ?? this.allowPaidBroadcast,
  paidMessageStarCount: paidMessageStarCount ?? this.paidMessageStarCount,
  updateOrderOfInstalledStickerSets:
      updateOrderOfInstalledStickerSets ??
      this.updateOrderOfInstalledStickerSets,
  schedulingState: schedulingState != null
      ? schedulingState()
      : this.schedulingState,
  effectId: effectId ?? this.effectId,
  sendingId: sendingId ?? this.sendingId,
  onlyPreview: onlyPreview ?? this.onlyPreview,
);