InputMedia.animation constructor

const InputMedia.animation({
  1. @JsonKey(name: 'type') @Default(InputMediaType.animation) InputMediaType type,
  2. @JsonKey(name: 'media') @InputFileConverter() required InputFile media,
  3. @JsonKey(name: 'thumbnail') @InputFileConverter() InputFile? thumbnail,
  4. @JsonKey(name: 'caption') String? caption,
  5. @JsonKey(name: 'parse_mode') ParseMode? parseMode,
  6. @JsonKey(name: 'caption_entities') List<MessageEntity>? captionEntities,
  7. @JsonKey(name: 'width') int? width,
  8. @JsonKey(name: 'height') int? height,
  9. @JsonKey(name: 'duration') int? duration,
  10. @JsonKey(name: 'has_spoiler') bool? hasSpoiler,
  11. @JsonKey(name: 'show_caption_above_media') bool? showCaptionAboveMedia,
})

Represents an animation to be sent

Implementation

const factory InputMedia.animation({
  /// Type of input media.
  @JsonKey(name: 'type')
  @Default(InputMediaType.animation)
  final InputMediaType type,

  /// The file to send
  @JsonKey(name: 'media')
  @InputFileConverter()
  required final InputFile media,

  /// Optional. Thumbnail of the file sent.
  @JsonKey(name: 'thumbnail')
  @InputFileConverter()
  final InputFile? thumbnail,

  /// Optional. Caption of the video to be sent, 0-1024 characters after
  /// entities parsing
  @JsonKey(name: 'caption') final String? caption,

  /// Optional. Mode for parsing entities in the video caption. See formatting
  /// options for more details.
  @JsonKey(name: 'parse_mode') final ParseMode? parseMode,

  /// Optional. List of special entities that appear in the caption, which can
  /// be specified instead of parse_mode
  @JsonKey(name: 'caption_entities')
  final List<MessageEntity>? captionEntities,

  /// Optional. Animation width
  @JsonKey(name: 'width') final int? width,

  /// Optional. Animation height
  @JsonKey(name: 'height') final int? height,

  /// Optional. Animation duration in seconds
  @JsonKey(name: 'duration') final int? duration,

  /// Optional. Pass True if the animation needs to be covered with a spoiler
  /// animation
  @JsonKey(name: 'has_spoiler') final bool? hasSpoiler,

  /// Optional. True, if the caption must be shown above the message media
  @JsonKey(name: 'show_caption_above_media')
  final bool? showCaptionAboveMedia,
}) = InputMediaAnimation;