Rename internal.data.builtin to internal.data.builtins

This commit is contained in:
Him188 2020-09-02 20:57:32 +08:00
parent 85fa61115e
commit 2b59dec65d
5 changed files with 40 additions and 4 deletions

View File

@ -24,7 +24,8 @@ import net.mamoe.mirai.console.command.BuiltInCommands
import net.mamoe.mirai.console.command.Command.Companion.primaryName import net.mamoe.mirai.console.command.Command.Companion.primaryName
import net.mamoe.mirai.console.data.PluginDataStorage import net.mamoe.mirai.console.data.PluginDataStorage
import net.mamoe.mirai.console.internal.command.CommandManagerImpl import net.mamoe.mirai.console.internal.command.CommandManagerImpl
import net.mamoe.mirai.console.internal.data.builtin.ConsoleDataScope import net.mamoe.mirai.console.internal.data.builtins.AutoLoginConfig
import net.mamoe.mirai.console.internal.data.builtins.ConsoleDataScope
import net.mamoe.mirai.console.internal.plugin.CuiPluginCenter import net.mamoe.mirai.console.internal.plugin.CuiPluginCenter
import net.mamoe.mirai.console.internal.plugin.PluginManagerImpl import net.mamoe.mirai.console.internal.plugin.PluginManagerImpl
import net.mamoe.mirai.console.plugin.PluginLoader import net.mamoe.mirai.console.plugin.PluginLoader
@ -105,6 +106,16 @@ internal object MiraiConsoleImplementationBridge : CoroutineScope, MiraiConsoleI
mainLogger.info { "${PluginManager.plugins.size} plugin(s) loaded." } mainLogger.info { "${PluginManager.plugins.size} plugin(s) loaded." }
mainLogger.info { "mirai-console started successfully." } mainLogger.info { "mirai-console started successfully." }
for ((id, password) in AutoLoginConfig.plainPasswords) {
mainLogger.info { "Auto-login $id" }
MiraiConsole.addBot(id, password)
}
for ((id, password) in AutoLoginConfig.md5Passwords) {
mainLogger.info { "Auto-login $id" }
MiraiConsole.addBot(id, password)
}
// Only for initialize // Only for initialize
} }
} }

View File

@ -0,0 +1,25 @@
package net.mamoe.mirai.console.internal.data.builtins
import net.mamoe.mirai.console.data.AutoSavePluginConfig
import net.mamoe.mirai.console.data.ValueDescription
import net.mamoe.mirai.console.data.value
internal object AutoLoginConfig : AutoSavePluginConfig() {
override val saveName: String
get() = "AutoLogin"
@ValueDescription(
"""
账号和明文密码列表
"""
)
val plainPasswords: MutableMap<Long, String> by value(mutableMapOf())
@ValueDescription(
"""
账号和 MD5 密码列表
"""
)
val md5Passwords: MutableMap<Long, String> by value(mutableMapOf())
}

View File

@ -9,7 +9,7 @@
@file:Suppress("MemberVisibilityCanBePrivate") @file:Suppress("MemberVisibilityCanBePrivate")
package net.mamoe.mirai.console.internal.data.builtin package net.mamoe.mirai.console.internal.data.builtins
import net.mamoe.mirai.Bot import net.mamoe.mirai.Bot
import net.mamoe.mirai.console.data.AutoSavePluginConfig import net.mamoe.mirai.console.data.AutoSavePluginConfig

View File

@ -7,7 +7,7 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE * https://github.com/mamoe/mirai/blob/master/LICENSE
*/ */
package net.mamoe.mirai.console.internal.data.builtin package net.mamoe.mirai.console.internal.data.builtins
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import net.mamoe.mirai.console.MiraiConsole import net.mamoe.mirai.console.MiraiConsole

View File

@ -14,7 +14,7 @@
package net.mamoe.mirai.console.util package net.mamoe.mirai.console.util
import net.mamoe.mirai.Bot import net.mamoe.mirai.Bot
import net.mamoe.mirai.console.internal.data.builtin.BotManagerImpl import net.mamoe.mirai.console.internal.data.builtins.BotManagerImpl
import net.mamoe.mirai.contact.User import net.mamoe.mirai.contact.User
public interface BotManager { public interface BotManager {