Compare commits

..

No commits in common. "2a18a0bedda739823b6048387c1adb1526416c36" and "8a2a9564b837046a25bba0f7b9f7bfb2aefd28ae" have entirely different histories.

3 changed files with 7 additions and 19 deletions

View file

@ -14,7 +14,7 @@ val ownerID = 372703841151614976L
group = "net.moonleay.rssbot" group = "net.moonleay.rssbot"
version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" } version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" }
?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" } ?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" }
?: "0.3.4" ?: "0.3.3"
val kordver = "1.5.10-SNAPSHOT" val kordver = "1.5.10-SNAPSHOT"
val coroutinesver = "1.7.3" val coroutinesver = "1.7.3"

View file

@ -94,10 +94,10 @@ object FeedUpdater : ICronjob {
if (rssData.description == null) "No description" else Remark(EmbedUtil.getHTMLtoMarkdownOptions()).convertFragment( if (rssData.description == null) "No description" else Remark(EmbedUtil.getHTMLtoMarkdownOptions()).convertFragment(
rssData.description!! rssData.description!!
), ),
rssData.link ?: "https://moonleay.net/404", rssData.link ?: "https://moonleay.net/",
rssData.image ?: "", rssData.image ?: "",
if (rssData.link != null) EmbedUtil.getSiteLogo(rssData.link!!) else "https://static.moonleay.net/img/rssbot/no-image.png", if (rssData.link != null) EmbedUtil.getSiteLogo(rssData.link!!) else "https://static.moonleay.net/img/rssbot/no-image.png",
data.feedName, "Manual Feed",
rssData.pubDate ?: "unknown" rssData.pubDate ?: "unknown"
) )
) )

View file

@ -178,27 +178,15 @@ object MessageUtil {
): EmbedBuilder { ): EmbedBuilder {
val ebb = EmbedBuilder() val ebb = EmbedBuilder()
val now: LocalDateTime = LocalDateTime.now() val now: LocalDateTime = LocalDateTime.now()
var desc = if (description != "No description") description else "" if (title.length > 25)
val articleLink = "\n[[open full article]($url)]" ebb.title = title.substring(0, 25) + "..."
if (title.length > 255){
ebb.title = title.substring(0, 252) + "..."
if (title != desc)
desc = "..." + title.substring(252, title.length) + "\n\n" + desc
}
else else
ebb.title = title ebb.title = title
var athr = author
if (author.length > 255) {
athr = author.substring(0, 252) + "..."
}
ebb.author { ebb.author {
this.name = athr this.name = author
this.icon = logo this.icon = logo
} }
if (desc.length > 4096 - 2 - articleLink.length){ ebb.description = "${if (description != "No description") description else ""}\n[[open full article]($url)]"
desc = desc.substring(0, 4096 - 2 - articleLink.length) + "..."
}
ebb.description = "${desc}${articleLink}"
ebb.color = color.color.color ebb.color = color.color.color
ebb.footer { ebb.footer {
this.text = "> rssbot, ($feedName) \n/ pub $published \n/ rel ${dtf.format(now)}" this.text = "> rssbot, ($feedName) \n/ pub $published \n/ rel ${dtf.format(now)}"