Skip to content

Image

Implementation of discords Image object as a Luau builder.

https://discord.com/developers/docs/resources/message#embed-object-embed-image-structure

Image.url  :: string

Source url of image (only supports http(s) and attachments)

Image.proxyUrl  :: string?

A proxied url of the image

Image.height  :: number?

Height of image

Image.width  :: number?

Width of image

Image : setUrl ( url proxyUrl )  -> Image

Set the image url for this embed.

Parameters

url: string
proxyUrl: string?

Returns

Image
Image : setHeight ( height )  -> Image

Set the image height for this embed.

Parameters

height: number

Returns

Image
Image : setWidth ( width )  -> Image

Set the image width for this embed.

Parameters

width: number

Returns

Image
Image : build ( )  -> JSON

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

Returns

JSON
Image . new ( resource )  -> Image

Responsible for creating a new Image.

local image = Image.new({
url = "https://example.com/image.png",
height = 100,
width = 100
})

Parameters

resource: {
url: string,
proxyUrl: string?,
height: number?,
width: number?,
}

Returns

Image