mirror of
https://github.com/InsanusMokrassar/PlaguBot.git
synced 2024-06-29 04:47:41 +00:00
19 lines
542 B
Kotlin
19 lines
542 B
Kotlin
package dev.inmo.plagubot
|
|
|
|
import dev.inmo.plagubot.config.*
|
|
import kotlinx.coroutines.*
|
|
import kotlinx.serialization.InternalSerializationApi
|
|
import java.io.File
|
|
|
|
/**
|
|
* This method by default expects one argument in [args] field: path to config
|
|
*/
|
|
@InternalSerializationApi
|
|
suspend fun main(args: Array<String>) {
|
|
val (configPath) = args
|
|
val file = File(configPath)
|
|
val config = configAndPluginsConfigJsonFormat.decodeFromString(PluginsConfigurationSerializer, file.readText()) as Config
|
|
|
|
PlaguBot(config).start().join()
|
|
}
|