Attachment class

An attachment in a Message.

Note that although this class implements CdnAsset, not all operations are supported. Notably, CdnFormats and sizes are not supported.

External references:

Implemented types

Properties

base HttpRoute
The base URL of the asset.
no setteroverride
client Nyxx
The client this asset is associated with.
no setteroverride
contentType String?
The content type of the attached file.
final
defaultFormat CdnFormat
The default format for this asset if none is specified.
no setteroverride
description String?
A description of the attached file.
final
duration Duration?
The duration of this audio file for voice messages.
final
fileName String
The name of the attached file.
final
flags AttachmentFlags?
This attachment's flags.
final
hash String
The hash of the asset.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
height int?
If the file is an image, the height of the image in pixels.
final
id Snowflake
This attachment's ID.
final
isAnimated bool
Whether this asset is an animated image.
no setteroverride
isEphemeral bool
Whether this attachment is ephemeral.
final
manager MessageManager
The manager for this Attachment.
final
proxiedUrl Uri
A proxied URL from which the attached file can be downloaded.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
The size of the attached file in bytes.
final
url Uri
A URL from which the attached file can be downloaded.
final
waveform List<int>?
A sampled waveform for voice messages.
final
width int?
If the file is an image, the width of the image in pixels.
final

Methods

defaultToString() String
Same as toString, but only called when dart:mirrors is not available.
inherited
fetch({CdnFormat? format, int? size}) Future<Uint8List>
Fetch this asset and return its binary data.
override
fetchStreamed({CdnFormat? format, int? size}) Stream<List<int>>
Fetch this asset and return a stream of its binary data.
override
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