Class ThumbnailBuilder
- Namespace
- Discord
- Assembly
- Discord.Net.Core.dll
public class ThumbnailBuilder : IMessageComponentBuilder
- Inheritance
-
ThumbnailBuilder
- Implements
- Inherited Members
- Extension Methods
Constructors
ThumbnailBuilder()
Initializes a new instance of the ThumbnailBuilder.
public ThumbnailBuilder()
ThumbnailBuilder(ThumbnailComponent)
Initializes a new ThumbnailBuilder from existing component.
public ThumbnailBuilder(ThumbnailComponent component)
Parameters
component
ThumbnailComponent
ThumbnailBuilder(UnfurledMediaItemProperties, string, bool)
Initializes a new instance of the ThumbnailBuilder.
public ThumbnailBuilder(UnfurledMediaItemProperties media, string description = null, bool isSpoiler = false)
Parameters
media
UnfurledMediaItemPropertiesdescription
stringisSpoiler
bool
Fields
MaxDescriptionLength
Gets the maximum length of the description.
public const int MaxDescriptionLength = 1024
Field Value
Properties
Description
Gets or sets the description of the thumbnail.
public string Description { get; set; }
Property Value
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 thumbnail is a spoiler.
public bool IsSpoiler { get; set; }
Property Value
Media
Gets or sets the media of the thumbnail.
public UnfurledMediaItemProperties Media { get; set; }
Property Value
Type
Gets the type of the component.
public ComponentType Type { get; }
Property Value
Methods
Build()
Runs validation checks and builds the component.
public ThumbnailComponent Build()
Returns
WithDescription(string)
Sets the description of the thumbnail.
public ThumbnailBuilder WithDescription(string description)
Parameters
description
string
Returns
- ThumbnailBuilder
The current builder.
WithMedia(UnfurledMediaItemProperties)
Sets the media of the thumbnail.
public ThumbnailBuilder WithMedia(UnfurledMediaItemProperties media)
Parameters
Returns
- ThumbnailBuilder
The current builder.
WithSpoiler(bool)
Sets whether the thumbnail is a spoiler.
public ThumbnailBuilder WithSpoiler(bool isSpoiler)
Parameters
isSpoiler
bool
Returns
- ThumbnailBuilder
The current builder.