AttachmentBuilder class
Helper for sending attachment in messages. Allows to create attachment from path, File or bytes.
Constructors
-
AttachmentBuilder.bytes(List<
int> bytes, String name, {bool? spoiler}) -
Creates attachment from provided bytes
factory
- AttachmentBuilder.file(File file, {String? name, bool? spoiler})
-
Create attachment from specified file instance. Name will be automatically extracted from path if no name provided.
factory
- AttachmentBuilder.path(String path, {String? name, 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.factory
Properties
- attachUrl → String
-
Generate Attachment string
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getBase64(
) → String - Returns attachment encoded in Data URI scheme format See: https://discord.com/developers/docs/reference#image-data
-
getMultipartFile(
) → MultipartFile - creates instance of MultipartFile from attachment
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited