feat: improved RSSEmbed
Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
parent
e4a593b7d3
commit
0c7f51ba72
1 changed files with 4 additions and 3 deletions
|
@ -174,11 +174,12 @@ object MessageUtil {
|
||||||
imageUrl: String,
|
imageUrl: String,
|
||||||
logo: String,
|
logo: String,
|
||||||
feedName: String,
|
feedName: String,
|
||||||
|
published: String,
|
||||||
): EmbedBuilder {
|
): EmbedBuilder {
|
||||||
val ebb = EmbedBuilder()
|
val ebb = EmbedBuilder()
|
||||||
val now: LocalDateTime = LocalDateTime.now()
|
val now: LocalDateTime = LocalDateTime.now()
|
||||||
if (title.length > 250)
|
if (title.length > 25)
|
||||||
ebb.title = title.substring(0, 250) + "[...]"
|
ebb.title = title.substring(0, 25) + "..."
|
||||||
else
|
else
|
||||||
ebb.title = title
|
ebb.title = title
|
||||||
ebb.author {
|
ebb.author {
|
||||||
|
@ -188,7 +189,7 @@ object MessageUtil {
|
||||||
ebb.description = "${if (description != "No description") description else ""}\n[[open full article]]($url)"
|
ebb.description = "${if (description != "No description") description else ""}\n[[open full article]]($url)"
|
||||||
ebb.color = color.color.color
|
ebb.color = color.color.color
|
||||||
ebb.footer {
|
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"
|
this.icon = "https://static.moonleay.net/img/rss.png"
|
||||||
}
|
}
|
||||||
ebb.thumbnail {
|
ebb.thumbnail {
|
||||||
|
|
Loading…
Reference in a new issue