Table of Contents

Class FileComponentBuilder

Namespace
Discord
Assembly
Discord.Net.Core.dll
public class FileComponentBuilder : IMessageComponentBuilder
Inheritance
FileComponentBuilder
Implements
Inherited Members
Extension Methods

Constructors

FileComponentBuilder()

Initializes a new instance of the FileComponentBuilder.

public FileComponentBuilder()

FileComponentBuilder(FileComponent)

Initializes a new FileComponentBuilder from existing component.

public FileComponentBuilder(FileComponent file)

Parameters

file FileComponent

FileComponentBuilder(UnfurledMediaItemProperties, bool, int?)

Initializes a new instance of the FileComponentBuilder.

public FileComponentBuilder(UnfurledMediaItemProperties media, bool isSpoiler = false, int? id = null)

Parameters

media UnfurledMediaItemProperties
isSpoiler bool
id int?

Properties

File

Gets or sets the file for the component.

public UnfurledMediaItemProperties File { get; set; }

Property Value

UnfurledMediaItemProperties

Remarks

Only attachment URLs are supported.

Id

Gets or sets the id for the component. An autoincremented id will be assigned if not set.

public int? Id { get; set; }

Property Value

int?

IsSpoiler

Gets or sets whether the file is a spoiler.

public bool? IsSpoiler { get; set; }

Property Value

bool?

Type

Gets the type of the component.

public ComponentType Type { get; }

Property Value

ComponentType

Methods

Build()

Runs validation checks and builds the component.

public FileComponent Build()

Returns

FileComponent

WithFile(UnfurledMediaItemProperties)

Sets the file for the component.

public FileComponentBuilder WithFile(UnfurledMediaItemProperties file)

Parameters

file UnfurledMediaItemProperties

Returns

FileComponentBuilder

The current builder.

WithIsSpoiler(bool?)

Sets whether the file is a spoiler.

public FileComponentBuilder WithIsSpoiler(bool? isSpoiler)

Parameters

isSpoiler bool?

Returns

FileComponentBuilder

The current builder.