Compare commits
2 commits
672982ef37
...
e9fac0d687
Author | SHA1 | Date | |
---|---|---|---|
e9fac0d687 | |||
d2af0fce94 |
4 changed files with 28 additions and 20 deletions
|
@ -21,9 +21,9 @@ import org.jetbrains.gradle.ext.TaskTriggersConfig
|
|||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "1.8.20"
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.6"
|
||||
kotlin("jvm") version "1.9.10"
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1"
|
||||
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7"
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
|
@ -32,14 +32,14 @@ val ownerID = 372703841151614976L
|
|||
group = "net.moonleay.liljudd"
|
||||
version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" }
|
||||
?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" }
|
||||
?: "2.5.5"
|
||||
?: "2.5.6"
|
||||
|
||||
val kordver = "1.5.6"
|
||||
val coroutinesver = "1.1.0"
|
||||
val ktor_version = "2.3.0"
|
||||
val exposedver = "0.40.1"
|
||||
val postgresver = "42.3.8"
|
||||
val krontabver = "2.1.2"
|
||||
val kordver = "1.5.9-SNAPSHOT"
|
||||
val coroutinesver = "1.7.3"
|
||||
val ktor_version = "2.3.4"
|
||||
val exposedver = "0.43.0"
|
||||
val postgresver = "42.6.0"
|
||||
val krontabver = "2.2.0"
|
||||
|
||||
val mavenArtifact = "lilJudd"
|
||||
project.base.archivesName.set(mavenArtifact)
|
||||
|
@ -72,6 +72,14 @@ repositories {
|
|||
}
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots")
|
||||
}
|
||||
maven {
|
||||
name = "sonatype 2"
|
||||
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
|
||||
}
|
||||
}
|
||||
|
||||
val shadow by configurations.getting
|
||||
|
@ -95,14 +103,14 @@ dependencies {
|
|||
|
||||
//Korntab
|
||||
shadow("dev.inmo:krontab:$krontabver")
|
||||
"shadow"("io.ktor:ktor-client-core-jvm:2.3.1")
|
||||
"shadow"("io.ktor:ktor-client-cio-jvm:2.3.1")
|
||||
"shadow"("io.ktor:ktor-client-core-jvm:2.3.4")
|
||||
"shadow"("io.ktor:ktor-client-cio-jvm:2.3.4")
|
||||
}
|
||||
|
||||
|
||||
val targetJavaVersion = 17
|
||||
val templateSrc = project.rootDir.resolve("src/main/templates")
|
||||
val templateDest = project.buildDir.resolve("generated/templates")
|
||||
val templateDest = project.projectDir.resolve("build/generated/templates")
|
||||
val templateProps = mapOf(
|
||||
"version" to project.version as String,
|
||||
"ownerID" to ownerID,
|
||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -18,6 +18,6 @@
|
|||
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
|
@ -95,7 +95,7 @@ object AvailabilityManager : IFeature {
|
|||
val weekday = ZonedDateTime.now().dayOfWeek // The current week day
|
||||
val weekStamp = TimeUtil.getWeekStamp().toEpochSecond() * 1000 // The current week time stamp
|
||||
Logger.out("It is week ${weekStamp} and day ${weekday}/${TimeUtil.getDayOfMonthInt(weekday)} of the week.")
|
||||
val g = Bot.bot.kordRef.getGuildOrThrow(Snowflake(tpmd.serverID))
|
||||
val g = Bot.bot.kordRef.getGuild(Snowflake(tpmd.serverID))
|
||||
// Get all members with the role
|
||||
val mce = g.requestMembers {
|
||||
this.requestAllMembers()
|
||||
|
@ -139,7 +139,7 @@ object AvailabilityManager : IFeature {
|
|||
.getMemberOrNull(Snowflake(tid)) == null
|
||||
)
|
||||
continue// This member does not exist anymore.
|
||||
val member = Bot.bot.kordRef.getGuildOrThrow(Snowflake(tpmd.serverID))
|
||||
val member = Bot.bot.kordRef.getGuild(Snowflake(tpmd.serverID))
|
||||
.getMember(Snowflake(tid)) // Get the member
|
||||
if (member.roleIds.contains(Snowflake(pnrd.hasTimeRoleID)))
|
||||
continue // This member already has the role
|
||||
|
@ -175,13 +175,13 @@ object AvailabilityManager : IFeature {
|
|||
// Check if the channel and guild already exist in the db
|
||||
if (!alreadyExists) {
|
||||
// Create the roles in Discord
|
||||
val hasTimeRole = Bot.bot.kordRef.getGuildOrThrow(Snowflake(gID)).createRole {
|
||||
val hasTimeRole = Bot.bot.kordRef.getGuild(Snowflake(gID)).createRole {
|
||||
this.name = "available [${ch.data.name.value}]"
|
||||
this.mentionable = true
|
||||
}
|
||||
val htr = hasTimeRole.id.value.toLong()
|
||||
|
||||
val wantsNotifsRole = Bot.bot.kordRef.getGuildOrThrow(Snowflake(gID)).createRole {
|
||||
val wantsNotifsRole = Bot.bot.kordRef.getGuild(Snowflake(gID)).createRole {
|
||||
this.name = "notifications [${ch.data.name.value}]"
|
||||
this.mentionable = true
|
||||
}
|
||||
|
@ -226,9 +226,9 @@ object AvailabilityManager : IFeature {
|
|||
if (PlanningNotifierRolesRepository.existsInChannelFromSever(cID, gID)) {
|
||||
val entry = PlanningNotifierRolesRepository.getForChannelInServer(cID, gID)!!
|
||||
// delete all entries for this guild and channel combo
|
||||
Bot.bot.kordRef.getGuildOrThrow(Snowflake(gID))
|
||||
Bot.bot.kordRef.getGuild(Snowflake(gID))
|
||||
.getRoleOrNull(Snowflake(entry.hasTimeRoleID))?.delete()
|
||||
Bot.bot.kordRef.getGuildOrThrow(Snowflake(gID))
|
||||
Bot.bot.kordRef.getGuild(Snowflake(gID))
|
||||
.getRoleOrNull(Snowflake(entry.wantsToBeNotifiedID))?.delete()
|
||||
|
||||
// delete all found entries
|
||||
|
|
Loading…
Reference in a new issue