refactor(bot): 简化 ScalaBot 构造器的参数.

改动前的构造器参数大多是直接从 BotConfig 中传递进去, 这么做不利于添加新的参数, 因此改动后, BotConfig 将直接传递到 ScalaBot 的构造器中, 由 ScaleBot 内部按需获取参数进行初始化.
This commit is contained in:
2022-03-15 14:13:53 +08:00
parent a0344f251f
commit 22a824377a
2 changed files with 14 additions and 14 deletions

View File

@ -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}` 已启动." }