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"
|
||||
version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" }
|
||||
?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" }
|
||||
?: "0.3.0"
|
||||
?: "0.3.1"
|
||||
|
||||
val kordver = "1.5.10-SNAPSHOT"
|
||||
val coroutinesver = "1.7.3"
|
||||
|
|
|
@ -89,7 +89,6 @@ object Bot {
|
|||
FeedUpdater.update(true)
|
||||
}
|
||||
|
||||
|
||||
//Start the bot
|
||||
bot.start()
|
||||
}
|
||||
|
|
|
@ -80,8 +80,10 @@ object FeedUpdater : ICronjob {
|
|||
data.id
|
||||
)
|
||||
) || TimeUtil.getUnixTimeFromStamp(rssData.pubDate!!) < data.subscriptionTimestamp
|
||||
)
|
||||
) {
|
||||
Logger.out("Skipping ${rssData.guid} because it already exists or is too old")
|
||||
continue
|
||||
}
|
||||
val channel = Bot.bot.kordRef.getChannel(Snowflake(data.channelId))!!.asChannelOf<MessageChannel>()
|
||||
channel.createMessage {
|
||||
this.embeds.add(
|
||||
|
|
|
@ -25,6 +25,8 @@ import java.time.format.DateTimeFormatter
|
|||
object TimeUtil {
|
||||
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")
|
||||
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