Commit 97dda77f authored by Him188's avatar Him188

Requests input in IO dispatcher

parent cebd4a80
......@@ -62,9 +62,13 @@ class DefaultLoginSolver(
@MiraiExperimentalAPI
class DefaultLoginSolverImpl(
private val input: suspend () -> String,
input: suspend () -> String,
private val overrideLogger: MiraiLogger? = null
) : LoginSolver() {
private val input: suspend () -> String = suspend {
withContext(Dispatchers.IO) { input() }
}
override suspend fun onSolvePicCaptcha(bot: Bot, data: ByteArray): String? = loginSolverLock.withLock {
val logger = overrideLogger ?: bot.logger
val tempFile: File = createTempFile(suffix = ".png").apply { deleteOnExit() }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment