mirror of
https://github.com/InsanusMokrassar/PlaguBot.git
synced 2025-11-19 05:45:48 +00:00
update dependencies and add logging
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package dev.inmo.plagubot
|
||||
|
||||
import dev.inmo.kslog.common.*
|
||||
import dev.inmo.plagubot.config.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.serialization.InternalSerializationApi
|
||||
@@ -11,10 +12,13 @@ import java.io.File
|
||||
*/
|
||||
@InternalSerializationApi
|
||||
suspend fun main(args: Array<String>) {
|
||||
KSLog.default = KSLog("PlaguBot")
|
||||
val (configPath) = args
|
||||
val file = File(configPath)
|
||||
KSLog.i("Start read config from ${file.absolutePath}")
|
||||
val json = defaultJsonFormat.parseToJsonElement(file.readText()).jsonObject
|
||||
val config = defaultJsonFormat.decodeFromJsonElement(Config.serializer(), json)
|
||||
KSLog.i("Config has been read")
|
||||
|
||||
PlaguBot(json, config).start().join()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user