mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-10 21:34:51 +08:00
fully disable plugin
This commit is contained in:
parent
975ca6bb2b
commit
3b6530a406
@ -232,13 +232,26 @@ object PluginManager {
|
||||
}
|
||||
|
||||
|
||||
fun disablePlugin(
|
||||
plugin:PluginBase,
|
||||
exception: CancellationException? = null
|
||||
){
|
||||
nameToPluginBaseMap.remove(plugin.pluginName)
|
||||
pluginDescriptions.remove(plugin.pluginName)
|
||||
plugin.disable(exception)
|
||||
}
|
||||
|
||||
|
||||
@JvmOverloads
|
||||
fun disableAllPlugins(throwable: CancellationException? = null) {
|
||||
nameToPluginBaseMap.values.forEach {
|
||||
it.disable(throwable)
|
||||
}
|
||||
nameToPluginBaseMap.clear()
|
||||
pluginDescriptions.clear()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据插件名字找Jar的文件
|
||||
* null => 没找到
|
||||
|
Loading…
Reference in New Issue
Block a user