feat: improved RSSEmbed

Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
moonleay 2023-10-15 15:27:20 +02:00
parent e4a593b7d3
commit 0c7f51ba72

View file

@ -174,11 +174,12 @@ object MessageUtil {
imageUrl: String,
logo: String,
feedName: String,
published: String,
): EmbedBuilder {
val ebb = EmbedBuilder()
val now: LocalDateTime = LocalDateTime.now()
if (title.length > 250)
ebb.title = title.substring(0, 250) + "[...]"
if (title.length > 25)
ebb.title = title.substring(0, 25) + "..."
else
ebb.title = title
ebb.author {
@ -188,7 +189,7 @@ object MessageUtil {
ebb.description = "${if (description != "No description") description else ""}\n[[open full article]]($url)"
ebb.color = color.color.color
ebb.footer {
this.text = "> rssbot, ($feedName) / sent at ${dtf.format(now)}"
this.text = "> rssbot, ($feedName) \n/ pub $published \n/ rel ${dtf.format(now)}"
this.icon = "https://static.moonleay.net/img/rss.png"
}
ebb.thumbnail {