AttachmentBuilder.path constructor

AttachmentBuilder.path(
  1. String path, {
  2. String? name,
  3. bool? spoiler,
})

Open file at path then read it's contents and prepare to send. Name will be automatically extracted from path if no name provided.

Implementation

factory AttachmentBuilder.path(String path, {String? name, bool? spoiler}) =>
    AttachmentBuilder.file(File(path), name: name, spoiler: spoiler);