mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 09:50:16 +08:00
Add configurations for captcha
This commit is contained in:
parent
a0f170ccba
commit
f9986ffb44
@ -1,6 +1,7 @@
|
|||||||
package net.mamoe.mirai.network.protocol.tim.packet.login
|
package net.mamoe.mirai.network.protocol.tim.packet.login
|
||||||
|
|
||||||
import net.mamoe.mirai.network.protocol.tim.packet.login.LoginResult.Companion.SUCCESS
|
import net.mamoe.mirai.network.protocol.tim.packet.login.LoginResult.Companion.SUCCESS
|
||||||
|
import net.mamoe.mirai.utils.BotConfiguration
|
||||||
import kotlin.contracts.ExperimentalContracts
|
import kotlin.contracts.ExperimentalContracts
|
||||||
import kotlin.contracts.InvocationKind
|
import kotlin.contracts.InvocationKind
|
||||||
import kotlin.contracts.contract
|
import kotlin.contracts.contract
|
||||||
@ -72,6 +73,12 @@ inline class LoginResult(val id: Byte) {
|
|||||||
@JvmStatic
|
@JvmStatic
|
||||||
val NETWORK_UNAVAILABLE = LoginResult(9)
|
val NETWORK_UNAVAILABLE = LoginResult(9)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需要验证码且 [BotConfiguration.failOnCaptcha] 为 `true`
|
||||||
|
*/
|
||||||
|
@JvmStatic
|
||||||
|
val CAPTCHA = LoginResult(10)
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val values: List<LoginResult> by lazy {
|
val values: List<LoginResult> by lazy {
|
||||||
listOf(
|
listOf(
|
||||||
|
@ -42,7 +42,10 @@ class BotConfiguration {
|
|||||||
* 一旦心跳超时, 整个网络服务将会重启 (将消耗约 1s). 除正在进行的任务 (如图片上传) 会被中断外, 事件和插件均不受影响.
|
* 一旦心跳超时, 整个网络服务将会重启 (将消耗约 1s). 除正在进行的任务 (如图片上传) 会被中断外, 事件和插件均不受影响.
|
||||||
*/
|
*/
|
||||||
var heartbeatTimeout: TimeSpan = 2.seconds
|
var heartbeatTimeout: TimeSpan = 2.seconds
|
||||||
|
/**
|
||||||
|
* 有验证码要求就失败
|
||||||
|
*/
|
||||||
|
var failOnCaptcha = false
|
||||||
/**
|
/**
|
||||||
* 验证码处理器
|
* 验证码处理器
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user