simple-robot / simpler-robot

Simple Robot,一个bot风格的Kotlin多平台事件调度框架,异步高效、Java友好!/ A Bot-style Kotlin Multiplatform event scheduling framework, asynchronous and high-performance, java-friendly! 🐱😼😻😸
https://simbot.forte.love
GNU Lesser General Public License v3.0
512 stars 44 forks source link

无法戳一戳 #630

Closed Chenyuxin221 closed 1 year ago

Chenyuxin221 commented 1 year ago

版本号

3.0.0-RC.3

附加版本

simbot-component-mirai-core:3.0.0.0-M4

涉及的编程语言

Kotlin

项目构建工具

Maven

涉及的组件库

mirai (QQ)

问题描述

MiraiNudgeEvent监听内使用封装好的replyNudge(),结果返回值为false

复现方式

@Listener
suspend fun MiraiNudgeEvent.nudge(){
   println(replyNudge())
}

相关日志

No response

其他补充

翻看源码发现无法进入if语句

@JvmSynthetic
    override suspend fun replyNudge(): Boolean {
        if (this is User) {
            return sendNudge(originalEvent.from.nudge())
        }

        return false
    }

使用 originalEvent.from.nudge().sendTo(originalEvent.subject) 可以成功回复戳一戳

Chenyuxin221 commented 1 year ago

之前使用的IPAD协议,使用replyNudge()也没报错,后面改成了自己写的就报错了,最后才改的AndroidPhone协议