Compare commits

..

No commits in common. "c3c6e9c9ee26a937c8edc1c65eea805eeeaddc44" and "54144ac3f9db2626b12e5b6641549962221f4cdd" have entirely different histories.

4 changed files with 4 additions and 7 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.1" ?: "0.3.0"
val kordver = "1.5.10-SNAPSHOT" val kordver = "1.5.10-SNAPSHOT"
val coroutinesver = "1.7.3" val coroutinesver = "1.7.3"

View file

@ -89,6 +89,7 @@ object Bot {
FeedUpdater.update(true) FeedUpdater.update(true)
} }
//Start the bot //Start the bot
bot.start() bot.start()
} }

View file

@ -80,10 +80,8 @@ object FeedUpdater : ICronjob {
data.id data.id
) )
) || TimeUtil.getUnixTimeFromStamp(rssData.pubDate!!) < data.subscriptionTimestamp ) || TimeUtil.getUnixTimeFromStamp(rssData.pubDate!!) < data.subscriptionTimestamp
) { )
Logger.out("Skipping ${rssData.guid} because it already exists or is too old")
continue continue
}
val channel = Bot.bot.kordRef.getChannel(Snowflake(data.channelId))!!.asChannelOf<MessageChannel>() val channel = Bot.bot.kordRef.getChannel(Snowflake(data.channelId))!!.asChannelOf<MessageChannel>()
channel.createMessage { channel.createMessage {
this.embeds.add( this.embeds.add(

View file

@ -25,8 +25,6 @@ import java.time.format.DateTimeFormatter
object TimeUtil { object TimeUtil {
fun getUnixTimeFromStamp(input: String): Long { // Pattern: Sun, 15 Oct 2023 11:04:57 GMT fun getUnixTimeFromStamp(input: String): Long { // Pattern: Sun, 15 Oct 2023 11:04:57 GMT
val formatter = DateTimeFormatter.ofPattern("EEE, dd MMM yyyy HH:mm:ss z") val formatter = DateTimeFormatter.ofPattern("EEE, dd MMM yyyy HH:mm:ss z")
val result = ZonedDateTime.parse(input, formatter).toEpochSecond() * 1000 return ZonedDateTime.parse(input, formatter).toEpochSecond() * 1000
Logger.out("Converted $input to $result")
return result
} }
} }