diff --git a/build.gradle.kts b/build.gradle.kts index 4cbb3ab..547bd30 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,7 +34,7 @@ implementation("org.apache.commons:commons-compress:1.25.0") implementation("org.apache.commons:commons-dbcp2:2.11.0") implementation("org.apache.commons:commons-lang3:3.14.0") - implementation("org.apache.httpcomponents.client5:httpclient5:5.2.2") + implementation("org.apache.httpcomponents.client5:httpclient5:5.2.1") implementation("org.apache.logging.log4j:log4j-core:2.22.0") implementation("org.apache.logging.log4j:log4j-slf4j2-impl:2.22.0") implementation("org.jline:jline:3.24.1") diff --git a/src/main/kotlin/net/taehui/twilight/system/PlatformSystem.kt b/src/main/kotlin/net/taehui/twilight/system/PlatformSystem.kt index 82148f0..ba263a5 100644 --- a/src/main/kotlin/net/taehui/twilight/system/PlatformSystem.kt +++ b/src/main/kotlin/net/taehui/twilight/system/PlatformSystem.kt @@ -45,7 +45,10 @@ } private val drawingStore = ConcurrentHashMap() - private lateinit var platformClient: Client + private val platformClient: Client = ObjectMapper().readValue( + Twilight::class.java.classLoader.getResourceAsStream("Client.json"), + Client::class.java + ) private var platform: JDA? = null private var qwilightPlatform: Guild? = null var platformAvatars = emptyList() @@ -67,10 +70,6 @@ } } - platformClient = ObjectMapper().readValue( - Twilight::class.java.classLoader.getResourceAsStream("Client.json"), - Client::class.java - ) platform = JDABuilder.createDefault(platformClient.platform) .enableIntents(GatewayIntent.MESSAGE_CONTENT, GatewayIntent.GUILD_MEMBERS) .addEventListeners(object : ListenerAdapter() { @@ -251,7 +250,9 @@ } else { logFuture { HttpClients.createDefault() - .use { drawingStore[avatarID] = it.execute(HttpGet(platformDrawing), HCDataHandler()) } + .use { + drawingStore[avatarID] = it.execute(HttpGet(platformDrawing), HCDataHandler()) + } } } }