AttachmentBuilder.file constructor
Create attachment from specified file instance. Name will be automatically extracted from path if no name provided.
Implementation
factory AttachmentBuilder.file(File file, {String? name, bool? spoiler}) {
final bytes = file.readAsBytesSync();
final fileName = name ?? path_utils.basename(file.path);
return AttachmentBuilder._new(bytes, fileName, spoiler);
}