From 8af0c3ac3324351f8ae5c51961c84e9e10173063 Mon Sep 17 00:00:00 2001 From: dalbodeule <11470513+dalbodeule@users.noreply.github.com> Date: Sun, 16 Jun 2024 12:38:05 +0900 Subject: [PATCH] follow period message handler end. --- build.gradle.kts | 42 +------------------ .../chzzk/{getFollowDate.kt => ChzzkApis.kt} | 0 .../mori/chzzk_bot/chzzk/MessageHandler.kt | 2 +- 3 files changed, 2 insertions(+), 42 deletions(-) rename src/main/kotlin/space/mori/chzzk_bot/chzzk/{getFollowDate.kt => ChzzkApis.kt} (100%) diff --git a/build.gradle.kts b/build.gradle.kts index dfe39cb..98ce8af 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,3 @@ -import org.graalvm.buildtools.gradle.tasks.BuildNativeImageTask - plugins { val kotlinVersion = "2.0.0" @@ -25,32 +23,6 @@ application { mainClass.set("${"${project.group}.${project.name}".lowercase()}.MainKt") } -graalvmNative { - agent { - trackReflectionMetadata.set(true) - - metadataCopy { - outputDirectories.add("src/main/resources/META-INF/native-image") - mergeWithExisting.set(true) - } - } - binaries { - binaries.all { - resources.autodetect() - } - named("main") { - useFatJar.set(true) - sharedLibrary.set(false) - buildArgs.add("-march=compatibility") - buildArgs.add("--enable-http") - buildArgs.add("--enable-https") - } - } - metadataRepository { - enabled.set(true) - } -} - repositories { mavenCentral() } @@ -61,7 +33,7 @@ dependencies { exclude(module = "opus-java") } // https://mvnrepository.com/artifact/io.github.R2turnTrue/chzzk4j - implementation("io.github.R2turnTrue:chzzk4j:0.0.7") + implementation("io.github.R2turnTrue:chzzk4j:0.0.8") implementation("ch.qos.logback:logback-classic:1.4.14") @@ -105,16 +77,4 @@ tasks.withType { }) duplicatesStrategy = DuplicatesStrategy.EXCLUDE -} - -tasks.register("generateReflectConfig") { - group = "build" - description = "Generate GraalVM reflection configuration using agent" - mainClass = application.mainClass - - classpath = sourceSets["main"].runtimeClasspath - - jvmArgs( - "-agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image" - ) } \ No newline at end of file diff --git a/src/main/kotlin/space/mori/chzzk_bot/chzzk/getFollowDate.kt b/src/main/kotlin/space/mori/chzzk_bot/chzzk/ChzzkApis.kt similarity index 100% rename from src/main/kotlin/space/mori/chzzk_bot/chzzk/getFollowDate.kt rename to src/main/kotlin/space/mori/chzzk_bot/chzzk/ChzzkApis.kt diff --git a/src/main/kotlin/space/mori/chzzk_bot/chzzk/MessageHandler.kt b/src/main/kotlin/space/mori/chzzk_bot/chzzk/MessageHandler.kt index 76475f3..fce04cb 100644 --- a/src/main/kotlin/space/mori/chzzk_bot/chzzk/MessageHandler.kt +++ b/src/main/kotlin/space/mori/chzzk_bot/chzzk/MessageHandler.kt @@ -89,7 +89,7 @@ class MessageHandler( } result = followPattern.replace(result) { - val following = getFollowDate("", msg.userId) + val following = getFollowDate(listener.chatId, msg.userId) val dateString: String? = following.content.streamingProperty["followDate"] val today = LocalDate.now()