Update RoHook.lua

This commit is contained in:
Norberto A 2020-05-24 17:02:19 +01:00 committed by GitHub
parent eac88a6501
commit 876e1ef040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -80,6 +80,16 @@ function module.newMessage(message)
end
function content.addEmbed(title, description)
if(title and string.len(title) > 256) then
warn("Title cannot be longer than 265 characters.")
title = string.sub(title, 1, 256)
end
if(description and string.len(description > 2048)) then
warn("Description cannot be longer than 2048 characters.")
description = string.sub(description, 1, 2048)
end
local embed = {
title = title,
description = description,
@ -103,16 +113,6 @@ function module.newMessage(message)
timestamp = "" --"YYYY-MM-DDTHH:MM:SS.MSSZ"
}
if(title and string.len(title) > 256) then
warn("Title cannot be longer than 265 characters.")
title = string.sub(title, 1, 256)
end
if(description and string.len(description > 2048)) then
warn("Description cannot be longer than 2048 characters.")
description = string.sub(description, 1, 2048)
end
table.insert(content.embeds, embed)
function embed.setColor(rgb)