Add CoroutineScope to PluginBase

This commit is contained in:
Him188 2020-01-19 00:00:23 +08:00
parent 3204f20439
commit bfc964f4f3

View File

@ -1,5 +1,6 @@
package net.mamoe.mirai.plugin
import kotlinx.coroutines.CoroutineScope
import net.mamoe.mirai.Bot
import net.mamoe.mirai.utils.DefaultLogger
import net.mamoe.mirai.utils.io.encodeToString
@ -7,9 +8,13 @@ import java.io.File
import java.net.URL
import java.net.URLClassLoader
import java.util.jar.JarFile
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext
abstract class PluginBase constructor() {
abstract class PluginBase : CoroutineScope {
override val coroutineContext: CoroutineContext = EmptyCoroutineContext
val dataFolder: File by lazy {
File(PluginManager.pluginsPath + pluginDescription.name).also { it.mkdir() }
}