InputMediaAudio.fromFile constructor

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

Implementation

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