copyWith method

BotInfo copyWith({
  1. String? shortDescription,
  2. String? description,
  3. Photo? photo()?,
  4. Animation? animation()?,
  5. int? managerBotUserId,
  6. BotMenuButton? menuButton()?,
  7. List<BotCommand>? commands,
  8. String? privacyPolicyUrl,
  9. ChatAdministratorRights? defaultGroupAdministratorRights()?,
  10. ChatAdministratorRights? defaultChannelAdministratorRights()?,
  11. AffiliateProgramInfo? affiliateProgram()?,
  12. int? webAppBackgroundLightColor,
  13. int? webAppBackgroundDarkColor,
  14. int? webAppHeaderLightColor,
  15. int? webAppHeaderDarkColor,
  16. BotVerificationParameters? verificationParameters()?,
  17. bool? canGetRevenueStatistics,
  18. bool? canManageEmojiStatus,
  19. bool? hasMediaPreviews,
  20. InternalLinkType? editCommandsLink()?,
  21. InternalLinkType? editDescriptionLink()?,
  22. InternalLinkType? editDescriptionMediaLink()?,
  23. InternalLinkType? editSettingsLink()?,
})

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

Implementation

BotInfo copyWith({
  String? shortDescription,
  String? description,
  Photo? Function()? photo,
  Animation? Function()? animation,
  int? managerBotUserId,
  BotMenuButton? Function()? menuButton,
  List<BotCommand>? commands,
  String? privacyPolicyUrl,
  ChatAdministratorRights? Function()? defaultGroupAdministratorRights,
  ChatAdministratorRights? Function()? defaultChannelAdministratorRights,
  AffiliateProgramInfo? Function()? affiliateProgram,
  int? webAppBackgroundLightColor,
  int? webAppBackgroundDarkColor,
  int? webAppHeaderLightColor,
  int? webAppHeaderDarkColor,
  BotVerificationParameters? Function()? verificationParameters,
  bool? canGetRevenueStatistics,
  bool? canManageEmojiStatus,
  bool? hasMediaPreviews,
  InternalLinkType? Function()? editCommandsLink,
  InternalLinkType? Function()? editDescriptionLink,
  InternalLinkType? Function()? editDescriptionMediaLink,
  InternalLinkType? Function()? editSettingsLink,
}) => BotInfo(
  shortDescription: shortDescription ?? this.shortDescription,
  description: description ?? this.description,
  photo: photo != null ? photo() : this.photo,
  animation: animation != null ? animation() : this.animation,
  managerBotUserId: managerBotUserId ?? this.managerBotUserId,
  menuButton: menuButton != null ? menuButton() : this.menuButton,
  commands: commands ?? this.commands,
  privacyPolicyUrl: privacyPolicyUrl ?? this.privacyPolicyUrl,
  defaultGroupAdministratorRights: defaultGroupAdministratorRights != null
      ? defaultGroupAdministratorRights()
      : this.defaultGroupAdministratorRights,
  defaultChannelAdministratorRights: defaultChannelAdministratorRights != null
      ? defaultChannelAdministratorRights()
      : this.defaultChannelAdministratorRights,
  affiliateProgram: affiliateProgram != null
      ? affiliateProgram()
      : this.affiliateProgram,
  webAppBackgroundLightColor:
      webAppBackgroundLightColor ?? this.webAppBackgroundLightColor,
  webAppBackgroundDarkColor:
      webAppBackgroundDarkColor ?? this.webAppBackgroundDarkColor,
  webAppHeaderLightColor:
      webAppHeaderLightColor ?? this.webAppHeaderLightColor,
  webAppHeaderDarkColor: webAppHeaderDarkColor ?? this.webAppHeaderDarkColor,
  verificationParameters: verificationParameters != null
      ? verificationParameters()
      : this.verificationParameters,
  canGetRevenueStatistics:
      canGetRevenueStatistics ?? this.canGetRevenueStatistics,
  canManageEmojiStatus: canManageEmojiStatus ?? this.canManageEmojiStatus,
  hasMediaPreviews: hasMediaPreviews ?? this.hasMediaPreviews,
  editCommandsLink: editCommandsLink != null
      ? editCommandsLink()
      : this.editCommandsLink,
  editDescriptionLink: editDescriptionLink != null
      ? editDescriptionLink()
      : this.editDescriptionLink,
  editDescriptionMediaLink: editDescriptionMediaLink != null
      ? editDescriptionMediaLink()
      : this.editDescriptionMediaLink,
  editSettingsLink: editSettingsLink != null
      ? editSettingsLink()
      : this.editSettingsLink,
);