Updated functions: setFooter, setImage, setThumbnail and setAuthor
This commit is contained in:
parent
a56857e9b3
commit
a9921e6590
|
@ -29,28 +29,41 @@ function RichEmbed:setColor()
|
||||||
end
|
end
|
||||||
|
|
||||||
function RichEmbed:setFooter(text, iconUrl)
|
function RichEmbed:setFooter(text, iconUrl)
|
||||||
-- footer.text is limited to 2048 characters
|
assert(text, "Text cannot be nil.")
|
||||||
|
assert(string.len(text) <= 2048, "Text cannot be longer than 2048 characters")
|
||||||
|
|
||||||
|
self.footer = {
|
||||||
|
text = text,
|
||||||
|
icon_url = iconUrl
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function RichEmbed:setImage()
|
function RichEmbed:setImage(url, height, width)
|
||||||
|
self.image = {
|
||||||
|
url = url,
|
||||||
|
height = height,
|
||||||
|
width = width
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function RichEmbed:setThumbnail()
|
function RichEmbed:setThumbnail(url, height, width)
|
||||||
|
self.thumbnail = {
|
||||||
|
url = url,
|
||||||
|
height = height,
|
||||||
|
width = width
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function RichEmbed:setAuthor(name, url, iconUrl)
|
function RichEmbed:setAuthor(name, url, iconUrl)
|
||||||
-- author.name is limited to 256 characters
|
|
||||||
if name then
|
if name then
|
||||||
assert(string.len(name) <= 256, "Name cannot be longer than 256 characters.")
|
assert(string.len(name) <= 256, "Name cannot be longer than 256 characters.")
|
||||||
end
|
end
|
||||||
|
|
||||||
local author = self.author or {
|
self.author = {
|
||||||
name = name,
|
name = name,
|
||||||
url = url,
|
url = url,
|
||||||
icon_url = iconUrl
|
icon_url = iconUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
self.author = author
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function RichEmbed:addField(name, value, inline)
|
function RichEmbed:addField(name, value, inline)
|
||||||
|
|
Reference in New Issue