Skip to content

ComponentThumbnail

Implementation of Discord’s Thumbnail component as a Luau builder. This is a Components V2 layout component, distinct from the embed thumbnail.

https://discord.com/developers/docs/components/reference#thumbnail

ComponentThumbnail.url  :: string?

The URL of the media to display. Use attachment://filename for uploaded files.

ComponentThumbnail.description  :: string?

Alt text for the thumbnail image.

ComponentThumbnail.spoiler  :: boolean?

Whether the thumbnail is blurred as a spoiler.

ComponentThumbnail : setUrl ( url )  -> ComponentThumbnail

Sets the media URL for the thumbnail.

Parameters

url: string

Returns

ComponentThumbnail
ComponentThumbnail : setDescription ( description )  -> ComponentThumbnail

Sets the alt text description for the thumbnail.

Parameters

description: string

Returns

ComponentThumbnail
ComponentThumbnail : setSpoiler ( spoiler )  -> ComponentThumbnail

Sets whether the thumbnail is blurred as a spoiler.

Parameters

spoiler: boolean

Returns

ComponentThumbnail
ComponentThumbnail : build ( )  -> JSON

Responsible for building the ComponentThumbnail JSON that can be parsed by the Discord API.

Returns

JSON
ComponentThumbnail . new ( resource )  -> ComponentThumbnail

Responsible for creating a new ComponentThumbnail.

Parameters

resource: {
url: string?,
description: string?,
spoiler: boolean?,
}

Returns

ComponentThumbnail