Compare commits

..

2 commits

Author SHA1 Message Date
c3c6e9c9ee chore: bump version
Signed-off-by: moonleay <contact@moonleay.net>
2023-10-15 22:25:06 +02:00
cc397f4b07 feat: added Logger output
Signed-off-by: moonleay <contact@moonleay.net>
2023-10-15 22:24:47 +02:00
4 changed files with 7 additions and 4 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.0" ?: "0.3.1"
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,7 +89,6 @@ object Bot {
FeedUpdater.update(true) FeedUpdater.update(true)
} }
//Start the bot //Start the bot
bot.start() bot.start()
} }

View file

@ -80,8 +80,10 @@ 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,6 +25,8 @@ 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")
return ZonedDateTime.parse(input, formatter).toEpochSecond() * 1000 val result = ZonedDateTime.parse(input, formatter).toEpochSecond() * 1000
Logger.out("Converted $input to $result")
return result
} }
} }