Compare commits
2 commits
54144ac3f9
...
c3c6e9c9ee
Author | SHA1 | Date | |
---|---|---|---|
c3c6e9c9ee | |||
cc397f4b07 |
4 changed files with 7 additions and 4 deletions
|
@ -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"
|
||||||
|
|
|
@ -89,7 +89,6 @@ object Bot {
|
||||||
FeedUpdater.update(true)
|
FeedUpdater.update(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Start the bot
|
//Start the bot
|
||||||
bot.start()
|
bot.start()
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue