Skip to content

Commit

Permalink
Bump Mikbot
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Aug 9, 2023
1 parent 2fb1245 commit 3108489
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 23 deletions.
1 change: 0 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM gradle:jdk19 as builder
FROM eclipse-temurin:20 as builder
WORKDIR /usr/app
COPY . .
RUN ./gradlew --no-daemon plugin:installBotArchive

FROM eclipse-temurin:19-jre-alpine
FROM eclipse-temurin:20-jre-alpine

WORKDIR /usr/app
COPY --from=builder /usr/app/plugin/build/installBot .
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
alias(libs.plugins.kotlin.serialization) apply false
}
allprojects {
version = "5.1.0"
version = "5.2.0"
group = "space.votebot"

repositories {
Expand All @@ -16,7 +16,7 @@ allprojects {
subprojects {
afterEvaluate {
configure<KotlinTopLevelExtension> {
jvmToolchain(19)
jvmToolchain(20)
}
}
}
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[versions]
kotlin = "1.8.22"
mikbot = "3.19.8"
ktor = "2.3.1"
kotlin = "1.9.0"
mikbot = "3.23.1"
ktor = "2.3.3"

[libraries]
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version = "1.5.1" }
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version = "1.6.0-RC" }
ktor-client-okhttp = { group = "io.ktor", name = "ktor-client-okhttp", version.ref = "ktor" }
ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version = "0.4.0" }

mikbot-gdpr = { group = "dev.schlaubi", name = "mikbot-gdpr" }

kordex-processor = { group = "com.kotlindiscord.kord.extensions", name = "annotation-processor", version = "1.5.7-SNAPSHOT" }
kordex-processor = { group = "com.kotlindiscord.kord.extensions", name = "annotation-processor", version = "1.5.8-SNAPSHOT" }
java-string-similarity = { group = "info.debatty", name = "java-string-similarity", version = "2.0.0" }

[plugins]
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
mikbot = { id = "dev.schlaubi.mikbot.gradle-plugin", version.ref = "mikbot" }
ksp = { id = "com.google.devtools.ksp", version = "1.8.22-1.0.11" }
ksp = { id = "com.google.devtools.ksp", version = "1.9.0-1.0.11" }
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "4.1.1"}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -133,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down Expand Up @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
1 change: 1 addition & 0 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ mikbotPlugin {
pluginId = "votebot"
provider = "votebot.space"
license = "MIT"
enableKordexProcessor = false
}

buildConfig {
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/main/kotlin/space/votebot/core/CSVGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ suspend fun Poll.generateCSV(kord: Kord): String = buildString {
append(header)
appendLine()
votes.forEach {
append(kord.getUser(Snowflake(it.userId))?.tag ?: "<unknown user>").append(it.userId)
append(kord.getUser(Snowflake(it.userId))?.username ?: "<unknown user>").append(it.userId)
append(',')
append(it.forOption + 1)
append(',')
Expand Down
5 changes: 2 additions & 3 deletions plugin/src/main/kotlin/space/votebot/core/Plugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import com.kotlindiscord.kord.extensions.extensions.event
import dev.kord.core.event.gateway.ReadyEvent
import dev.kord.gateway.PrivilegedIntent
import dev.schlaubi.mikbot.plugin.api.Plugin
import dev.schlaubi.mikbot.plugin.api.PluginContext
import dev.schlaubi.mikbot.plugin.api.PluginMain
import dev.schlaubi.mikbot.plugin.api.PluginWrapper
import dev.schlaubi.mikbot.plugin.api.config.Config
import dev.schlaubi.mikbot.plugin.api.config.Environment
import io.ktor.client.*
Expand All @@ -19,8 +19,7 @@ import org.litote.kmongo.serialization.registerSerializer
import space.votebot.commands.commands

@PluginMain
class VoteBotPlugin(wrapper: PluginWrapper) : Plugin(wrapper) {
@OptIn(ExperimentalSerializationApi::class, ExperimentalUnsignedTypes::class)
class VoteBotPlugin(wrapper: PluginContext) : Plugin(wrapper) {
override fun start() {
registerSerializer(ULong.serializer())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object UserMessageTransformer : RegexReplaceTransformer() {
val (userId) = match.destructured
return try {
val user = kord.getUser(Snowflake(userId)) ?: return null
return "${user.username}#${user.discriminator}"
return user.username
} catch (e: NumberFormatException) {
null
}
Expand Down

0 comments on commit 3108489

Please sign in to comment.