update dependencies and add logging

This commit is contained in:
2022-06-11 19:15:09 +06:00
parent 343c26a7f1
commit f9f56f6afb
7 changed files with 28 additions and 11 deletions

View File

@@ -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()
}