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
jsonModelJsonAttachment
Properties
ContentType
The attachment's media (MIME) type.
public string? ContentType { get; }
Property Value
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
Ephemeral
Whether this attachment is ephemeral.
public bool Ephemeral { get; }
Property Value
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
Flags
Additional information about the attachment's type.
public AttachmentFlags Flags { get; }
Property Value
Id
The unique identifier for this object.
public override ulong Id { get; }
Property Value
ProxyUrl
The attachment's source URL, proxied through Discord's CDN.
public string ProxyUrl { get; }
Property Value
Size
The attachment's size in bytes.
public long Size { get; }
Property Value
Title
The title of the attachment.
public string? Title { get; }
Property Value
Url
The attachment's source URL.
public string Url { get; }
Property Value
Methods
CreateFromJson(JsonAttachment, RestClient)
public static Attachment CreateFromJson(JsonAttachment jsonModel, RestClient client)
Parameters
jsonModelJsonAttachmentclientRestClient
Returns
GetExpirationInfo()
Returns expiration and issue info for the attachment's source URL.
public AttachmentExpirationInfo GetExpirationInfo()