mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 09:50:16 +08:00
#18, Make configuration inline
This commit is contained in:
parent
6cc8a33cf6
commit
5aa85d45bb
@ -91,7 +91,7 @@ suspend inline fun Bot.alsoLogin(): Bot = apply { login().requireSuccess() }
|
|||||||
* 使用在默认配置基础上修改的配置进行登录, 返回 [this]
|
* 使用在默认配置基础上修改的配置进行登录, 返回 [this]
|
||||||
*/
|
*/
|
||||||
@UseExperimental(ExperimentalContracts::class)
|
@UseExperimental(ExperimentalContracts::class)
|
||||||
suspend inline fun Bot.alsoLogin(noinline configuration: BotConfiguration.() -> Unit): Bot {
|
suspend inline fun Bot.alsoLogin(configuration: BotConfiguration.() -> Unit): Bot {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(configuration, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(configuration, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user