InputMediaAudio.withThumbnailFile constructor

InputMediaAudio.withThumbnailFile({
  1. required File thumbnail,
  2. required String media,
  3. String? caption,
  4. String? parseMode,
  5. List<MessageEntity>? captionEntities,
  6. int? duration,
  7. String? performer,
  8. String? title,
})

Implementation

factory InputMediaAudio.withThumbnailFile({
  required io.File thumbnail,
  required String media,
  String? caption,
  String? parseMode,
  List<MessageEntity>? captionEntities,
  int? duration,
  String? performer,
  String? title,
}) =>
    InputMediaAudio(
      media: media,
      thumbnail: 'attach://${thumbnail.path}',
      caption: caption,
      parseMode: parseMode,
      captionEntities: captionEntities,
      duration: duration,
      performer: performer,
      title: title,
    )..thumbnailFile = MultipartFile(
        thumbnail.path, thumbnail.openRead(), thumbnail.lengthSync(),
        filename: thumbnail.path.split('/').last);