InputMedia.audio constructor

const InputMedia.audio({
  1. @JsonKey(name: 'type') @Default(InputMediaType.audio) 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: 'duration') int? duration,
  8. @JsonKey(name: 'performer') String? performer,
  9. @JsonKey(name: 'title') String? title,
})

Represents an audio file to be treated as music to be sent.

Implementation

const factory InputMedia.audio({
  /// Type of input media.
  @JsonKey(name: 'type')
  @Default(InputMediaType.audio)
  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 audio to be sent, 0-1024 characters after
  /// entities parsing
  @JsonKey(name: 'caption') final String? caption,

  /// Optional. Mode for parsing entities in the audio 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. Duration of the audio in seconds
  @JsonKey(name: 'duration') final int? duration,

  /// Optional. Performer of the audio
  @JsonKey(name: 'performer') final String? performer,

  /// Optional. Title of the audio
  @JsonKey(name: 'title') final String? title,
}) = InputMediaAudio;