Table of Contents

Class Attachment

Namespace
NetCord
Assembly
NetCord.dll

Represents a message attachment, and its contained data.

public class Attachment : Entity, IEntity, ISpanFormattable, IFormattable, IEquatable<Entity>, IJsonModel<JsonAttachment>
Inheritance
Attachment
Implements
Derived
Inherited Members

Constructors

Attachment(JsonAttachment)

Represents a message attachment, and its contained data.

public Attachment(JsonAttachment jsonModel)

Parameters

jsonModel JsonAttachment

Properties

ContentType

The attachment's media (MIME) type.

public string? ContentType { get; }

Property Value

string

Description

Description for the attachment (max 1024 characters for attachments sent by message, max 200 characters for attachments used for sticker creation).

public string? Description { get; }

Property Value

string

Ephemeral

Whether this attachment is ephemeral.

public bool Ephemeral { get; }

Property Value

bool

FileName

Name of the attachment (max 1024 characters for attachments sent by message, 2-30 characters for attachments used for sticker creation).

public string FileName { get; }

Property Value

string

Flags

Additional information about the attachment's type.

public AttachmentFlags Flags { get; }

Property Value

AttachmentFlags

Id

The unique identifier for this object.

public override ulong Id { get; }

Property Value

ulong

ProxyUrl

The attachment's source URL, proxied through Discord's CDN.

public string ProxyUrl { get; }

Property Value

string

Size

The attachment's size in bytes.

public long Size { get; }

Property Value

long

Title

The title of the attachment.

public string? Title { get; }

Property Value

string

Url

The attachment's source URL.

public string Url { get; }

Property Value

string

Methods

CreateFromJson(JsonAttachment, RestClient)

public static Attachment CreateFromJson(JsonAttachment jsonModel, RestClient client)

Parameters

jsonModel JsonAttachment
client RestClient

Returns

Attachment

GetExpirationInfo()

Returns expiration and issue info for the attachment's source URL.

public AttachmentExpirationInfo GetExpirationInfo()

Returns

AttachmentExpirationInfo