InputMediaAnimation.withThumbnailFile constructor

InputMediaAnimation.withThumbnailFile({
  1. required String media,
  2. required File thumbnail,
  3. String? caption,
  4. String? parseMode,
  5. List<MessageEntity>? captionEntities,
  6. int? width,
  7. int? height,
  8. int? duration,
  9. bool? hasSpoiler,
})

Implementation

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