DreamVoid / MiraiMC

适用于Minecraft服务器的Mirai机器人
https://docs.miraimc.dreamvoid.me
GNU Affero General Public License v3.0
182 stars 15 forks source link

新增SMS短信验证解决器 #327

Closed Zhou-Shilin closed 1 year ago

Zhou-Shilin commented 1 year ago

功能描述

希望MiraiMC能支持Mirai的短信验证解决器,比如新增提交验证码的指令 (Mirai已支持短信验证解决器,但是MiraiMC没有适配)

[221月2023 14:39:28.401] [DefaultDispatcher-worker-4/WARN] [MiraiMC/]: Exception in resumeConnection.
net.mamoe.mirai.internal.network.components.LoginFailedExceptionAsNetworkException: This login session requires SMS verification, but current LoginSolver(me.dreamvoid.miraimc.internal.MiraiLoginSolver@56c4d363) does not support it. Please override `LoginSolver.onSolveDeviceVerification`.
    at net.mamoe.mirai.internal.network.handler.CommonNetworkHandler$StateConnecting$startState$2.invokeSuspend(CommonNetworkHandler.kt:248) ~[mirai-core-all-2.13.2.jar:?] {}
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) [mirai-core-all-2.13.2.jar:?] {}
    at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33) [mirai-core-all-2.13.2.jar:?] {}
    at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) [mirai-core-all-2.13.2.jar:?] {}
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) [mirai-core-all-2.13.2.jar:?] {}
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) [mirai-core-all-2.13.2.jar:?] {}
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) [mirai-core-all-2.13.2.jar:?] {}
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) [mirai-core-all-2.13.2.jar:?] {}
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) [mirai-core-all-2.13.2.jar:?] {}
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) [mirai-core-all-2.13.2.jar:?] {}
Caused by: net.mamoe.mirai.network.UnsupportedSmsLoginException: This login session requires SMS verification, but current LoginSolver(me.dreamvoid.miraimc.internal.MiraiLoginSolver@56c4d363) does not support it. Please override `LoginSolver.onSolveDeviceVerification`.
    at net.mamoe.mirai.utils.LoginSolver.onSolveDeviceVerification$suspendImpl(LoginSolver.kt:94) ~[mirai-core-all-2.13.2.jar:?] {}
    at net.mamoe.mirai.utils.LoginSolver.onSolveDeviceVerification(LoginSolver.kt) ~[mirai-core-all-2.13.2.jar:?] {}
    at net.mamoe.mirai.internal.network.components.SsoProcessorImpl$SlowLoginImpl.doLogin(SsoProcessor.kt:259) ~[mirai-core-all-2.13.2.jar:?] {}
    at net.mamoe.mirai.internal.network.components.SsoProcessorImpl$SlowLoginImpl$doLogin$1.invokeSuspend(SsoProcessor.kt) ~[mirai-core-all-2.13.2.jar:?] {}
    ... 9 more
[221月2023 14:39:28.401] [DefaultDispatcher-worker-4/WARN] [MiraiMC/]: Network selector received exception, closing bot. (net.mamoe.mirai.internal.network.components.LoginFailedExceptionAsNetworkException: This login session requires SMS verification, but current LoginSolver(me.dreamvoid.miraimc.internal.MiraiLoginSolver@56c4d363) does not support it. Please override `LoginSolver.onSolveDeviceVerification`.)
[221月2023 14:39:28.402] [Craft Scheduler Thread - 83/WARN] [MiraiMC/]: 登录机器人时出现异常,原因: This login session requires SMS verification, but current LoginSolver(me.dreamvoid.miraimc.internal.MiraiLoginSolver@56c4d363) does not support it. Please override `LoginSolver.onSolveDeviceVerification`.
[221月2023 14:39:28.403] [nioEventLoopGroup-4-5/INFO] [MiraiMC/]: Bot cancelled: Bot closed

使用方法

  1. /miraiverify sms <验证码>

额外说明

No response

DreamVoid commented 1 year ago

已经在最近一次提交中添加了,没发新版本而已,着急用可以用开发版

Zhou-Shilin commented 1 year ago

已经在最近一次提交中添加了,没发新版本而已,着急用可以用开发版

感谢!

AUndead commented 1 year ago

已经在最近一次提交中添加了,没发新版本而已,着急用可以用开发版

感谢!

所以这个短信验证怎么操作...