Show / Hide Table of Contents

Class Attachment

An attachment for the webhook. If this is NOT used in an Embed, it will be sent as a file instead. See the Attachment object structure for more information.

Inheritance
System.Object
Attachment
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Dishooks.Embeds
Assembly: cs.temp.dll.dll
Syntax
public class Attachment

Constructors

Attachment(String)

Create a new attachment with the given file path. Consider giving your file a description using Attachment(String, String) for increased accessibility.

Declaration
public Attachment(string path)
Parameters
Type Name Description
System.String path

The local path to the attachment.

Exceptions
Type Condition
System.IO.FileNotFoundException

If the file does not exist.

Attachment(String, String)

Create a new attachment with the given file path.

Declaration
public Attachment(string path, string description)
Parameters
Type Name Description
System.String path

The local path to the attachment.

System.String description

The Description of the attachment.

Exceptions
Type Condition
System.IO.FileNotFoundException

If the file does not exist.

Properties

Description

The description of the file attached. This is also known as alt text used for screen readers.

Declaration
public string Description { get; set; }
Property Value
Type Description
System.String

FileName

The name of the file attached. This is not the full path, please use the constructor Attachment(String) to set the full path.

Declaration
public string FileName { get; }
Property Value
Type Description
System.String

Id

Declaration
public int Id { get; set; }
Property Value
Type Description
System.Int32

Path

The path to the file.

Declaration
public string Path { get; set; }
Property Value
Type Description
System.String

Url

The url to the file.

Declaration
public string Url { get; }
Property Value
Type Description
System.String
In This Article
Back to top Generated by DocFX