Table of Contents

Class Attachment

Namespace
Discord
Assembly
Discord.Net.Rest.dll

Represents a message attachment found in a IUserMessage.

public class Attachment : IAttachment, ISnowflakeEntity, IEntity<ulong>
Inheritance
Attachment
Implements
Inherited Members
Extension Methods

Properties

ClipCreatedAt

Gets the timestamp of the clip. null if the attachment is not a clip.

public DateTimeOffset? ClipCreatedAt { get; }

Property Value

DateTimeOffset?

ClipParticipants

Gets users who participated in the clip.

public IReadOnlyCollection<RestUser> ClipParticipants { get; }

Property Value

IReadOnlyCollection<RestUser>

ContentType

Gets the media's MIME type if present; otherwise null.

public string ContentType { get; }

Property Value

string

CreatedAt

Gets when the snowflake was created.

public DateTimeOffset CreatedAt { get; }

Property Value

DateTimeOffset

A DateTimeOffset representing when the entity was first created.

Description

Gets the description of the attachment; or null if there is none set.

public string Description { get; }

Property Value

string

Duration

Gets the duration of the audio file. null if the attachment is not a voice message.

public double? Duration { get; }

Property Value

double?

Ephemeral

Gets whether or not this attachment is ephemeral.

public bool Ephemeral { get; }

Property Value

bool

true if the attachment is ephemeral; otherwise false.

Filename

Gets the filename of this attachment.

public string Filename { get; }

Property Value

string

A string containing the full filename of this attachment (e.g. textFile.txt).

Flags

Gets flags related to this to this attachment.

public AttachmentFlags Flags { get; }

Property Value

AttachmentFlags

Height

Gets the height of this attachment.

public int? Height { get; }

Property Value

int?

The height of this attachment if it is a picture; otherwise null.

Id

Gets the unique identifier for this object.

public ulong Id { get; }

Property Value

ulong

ProxyUrl

Gets a proxied URL of this attachment.

public string ProxyUrl { get; }

Property Value

string

A string containing the proxied URL of this attachment.

Size

Gets the file size of this attachment.

public int Size { get; }

Property Value

int

The size of this attachment in bytes.

Title

Gets the title of the clip. null if the clip has no title set.

public string Title { get; }

Property Value

string

Url

Gets the URL of this attachment.

public string Url { get; }

Property Value

string

A string containing the URL of this attachment.

Waveform

Gets the base64 encoded bytearray representing a sampled waveform. null if the attachment is not a voice message.

public string Waveform { get; }

Property Value

string

WaveformBytes

Gets the bytearray representing a sampled waveform. null if the attachment is not a voice message.

public byte[] WaveformBytes { get; }

Property Value

byte[]

Width

Gets the width of this attachment.

public int? Width { get; }

Property Value

int?

The width of this attachment if it is a picture; otherwise null.

Methods

ToString()

Returns the filename of this attachment.

public override string ToString()

Returns

string

A string containing the filename of this attachment.