InputMediaDocument.fromFile constructor

InputMediaDocument.fromFile({
  1. required File media,
  2. String? thumbnail,
  3. String? caption,
  4. String? parseMode,
  5. List<MessageEntity>? captionEntities,
  6. bool? disableContentTypeDetection,
})

Implementation

factory InputMediaDocument.fromFile(
        {required io.File media,
        String? thumbnail,
        String? caption,
        String? parseMode,
        List<MessageEntity>? captionEntities,
        bool? disableContentTypeDetection}) =>
    InputMediaDocument(
      media: 'attach://${media.path}',
      thumbnail: thumbnail,
      caption: caption,
      parseMode: parseMode,
      captionEntities: captionEntities,
      disableContentTypeDetection: disableContentTypeDetection,
    )..mediaFile = MultipartFile(
        media.path, media.openRead(), media.lengthSync(),
        filename: media.path.split('/').last);