Embed
Properties
Embed.title : string?
The title attached to the embed.
Embed.description : string?
The description attached to the embed.
Embed.url : string?
The url attached to the embed's title.
Embed.timestamp : string?
An ISO8601 timestamp attached to the embed's footer.
Embed.color : number?
A number representing the embed's color.
Embed.footer : {text : string, icon_url : string?, proxy_icon_url : string?}?
The embed's footer.
Info
proxy_icon_url is only returned if the embed object was returned by Discord.
Embed.image : {url : string, height : number?, width : number?, proxy_url : string?}?
The embed's image.
Info
height, width and proxy_url are only returned if the embed object was returned by Discord.
Embed.thumbnail : {url : string, height : number?, width : number?, proxy_url : string?}?
The embed's thumbnail.
Info
height, width and proxy_url are only returned if the embed object was returned by Discord.
Embed.author : {name : string, url : string?, icon_url : string?, proxy_icon_url : string?}?
The embed's author.
Warning
This is NOT an author object!
Info
proxy_icon_url is only returned if the embed object was returned by Discord.
Embed.fields : { {name : string, value : string, inLine : boolean?} }
A table of field objects that are attached to the embed.
Methods
Embed.new(title : string?, description : string?, url : string?) : Embed
This method returns a new Embed object.
Parameters
- title: The title of the embed.
- description: The description of the embed.
- url: The url attached to the embed's title.
Embed:setTitle(title : string) : nil
This method sets the embed's title.
Note
If the embed already has a title it'll be overridden.
Parameters
- title: The title of the embed.
Embed:setDescription(description : string) : nil
This method sets the embed's description.
Note
If the embed already has a description it'll be overridden.
Parameters
- description: The description of the embed.
Embed:setUrl(url : string) : nil
This method sets the embed's url.
Note
If the embed already has a url it'll be overridden.
Parameters
- url: The url attached to the embed's title.
Embed:setTimestamp(customTimestamp : string?) : nil
This method sets the embed's timestamp.
Note
If customTimestamp is left nil then the current timestamp will be used instead.
Note
If the embed already has a timestamp it'll be overridden.
Parameters
- customTimestamp: A custom ISO8601 timestamp for the embed.
Embed:setColor(color3 : Color3) : nil
This method sets the embed's color code.
Note
If the embed already has a color it'll be overridden.
Parameters
- color3: A color3 value.
Embed:setFooter(text : string, iconUrl : string?) : nil
This method sets the embed's footer.
Note
If the embed already has a footer it'll be overridden.
Warning
Only HTTPS urls are supported for the iconUrl parameter.
Parameters
- text: The footer's text.
- iconUrl: The footer's url.
Embed:setImage(url : string) : nil
This method sets the embed's image.
Note
If the embed already has an image it'll be overridden.
Warning
Only HTTPS urls are supported for the url parameter.
Parameters
- url: The image's url.
Embed:setThumbnail(url : string) : nil
This method sets the embed's thumbnail.
Note
If the embed already has a thumbnail it'll be overridden.
Warning
Only HTTPS urls are supported for the url parameter.
Parameters
- url: The thumbnail's url.
Embed:setAuthor(name : string, url : string?, iconUrl : string?) : nil
This method sets the embed's author.
Note
If the embed already has an author it'll be overridden.
Warning
Only HTTPS urls are supported for the iconUrl parameter.
Parameters
- name: The author's name.
- url: The author's url.
- iconUrl: The icon's url.
Embed:addField(name: string, value: string, inLine: boolean?): nil
This method adds a new field to the embed.
Parameters
- name: The field's name.
- value: The field's value.
- inLine: Whether the field should display inline.
Embed:totalCharacters(): number
This method returns the total amount of characters in the embed.
Embed:colorToRGB(): {r: number, g: number, b: number}?
This method returns the embed's color in rgb format.
Embed:_validate() : (boolean, string?)
This method validates the embed to avoid making a pointless request to Discord.
Warning
This method is not meant to be used outside Voyager's internal code.