mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-07-03 05:47:24 +00:00
refactor(bot): 简化 ScalaBot 构造器的参数.
改动前的构造器参数大多是直接从 BotConfig 中传递进去, 这么做不利于添加新的参数, 因此改动后, BotConfig 将直接传递到 ScalaBot 的构造器中, 由 ScaleBot 内部按需获取参数进行初始化.
This commit is contained in:
@ -112,14 +112,10 @@ internal class Launcher : AutoCloseable {
|
||||
)
|
||||
|
||||
val bot = ScalaBot(
|
||||
account.name,
|
||||
account.token,
|
||||
account.creatorId,
|
||||
BotDBMaker.getBotMaker(account),
|
||||
botOption,
|
||||
botConfig.extensions,
|
||||
extensionPackageFinders,
|
||||
botConfig.disableBuiltInAbility
|
||||
botConfig
|
||||
)
|
||||
botSessionMap[bot] = botApi.registerBot(bot)
|
||||
log.info { "机器人 `${bot.botUsername}` 已启动." }
|
||||
|
Reference in New Issue
Block a user