Add BotFactory.newBot defaults

This commit is contained in:
Him188 2020-12-18 14:26:44 +08:00
parent 61533fe8c1
commit b63df48729

View File

@ -20,13 +20,23 @@ public interface BotFactory {
/**
* 使用指定的 [配置][configuration] 构造 [Bot] 实例
*/
public fun newBot(qq: Long, password: String, configuration: BotConfiguration = BotConfiguration.Default): Bot
public fun newBot(qq: Long, password: String, configuration: BotConfiguration): Bot
/**
* 使用 [默认配置][BotConfiguration.Default] 构造 [Bot] 实例
*/
public fun newBot(qq: Long, password: String): Bot = newBot(qq, password, BotConfiguration.Default)
/**
* 使用指定的 [配置][configuration] 构造 [Bot] 实例
*/
public fun newBot(qq: Long, passwordMd5: ByteArray, configuration: BotConfiguration): Bot
/**
* 使用 [默认配置][BotConfiguration.Default] 构造 [Bot] 实例
*/
public fun newBot(qq: Long, passwordMd5: ByteArray): Bot = newBot(qq, passwordMd5, BotConfiguration.Default)
public companion object INSTANCE : BotFactory {
override fun newBot(qq: Long, password: String, configuration: BotConfiguration): Bot {
return Mirai.BotFactory.newBot(qq, password, configuration)