Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法从 QuoteReply 的 id 获取对应的回复引用消息 #247

Closed
Hai-tun opened this issue Apr 20, 2020 · 0 comments
Closed

无法从 QuoteReply 的 id 获取对应的回复引用消息 #247

Hai-tun opened this issue Apr 20, 2020 · 0 comments
Labels
M 优先级: 主要 t:bug 类型: bug x:protocol 属性: 协议相关
Milestone

Comments

@Hai-tun
Copy link

Hai-tun commented Apr 20, 2020

问题

    val bot = Bot(10000, "pw").alsoLogin()
    val message = bot.getFriend(10000).sendMessage(PlainText("======="))
    println(message.sourceId)
    bot.subscribeAlways<FriendMessage> {
        val quoteReply = it.message.firstIsInstanceOrNull<QuoteReply>()
        if (quoteReply != null)
        {
            println(quoteReply.originalMessage.contentToString())
            println(quoteReply.originalMessage.id)
            println(quoteReply.id)
        }
    }
    bot.join()

由于某些需要使用 Google Guava Cache 存了消息的 id 以便下次引用的时候取出
在收到消息后取出的消息 id 和之前完全不同
多次引用同一消息打印的 id 相同

换句话说 就是发送出去的消息和引用拿到的消息id不同

附打印输出

图片
图片
图片
图片

@Hai-tun Hai-tun added the t:bug 类型: bug label Apr 20, 2020
@Him188 Him188 added M 优先级: 主要 x:protocol 属性: 协议相关 labels Apr 20, 2020
@Him188 Him188 added this to the mirai-core 1.0.0 milestone Apr 20, 2020
@Him188 Him188 closed this as completed in 4a217d8 Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M 优先级: 主要 t:bug 类型: bug x:protocol 属性: 协议相关
Projects
None yet
Development

No branches or pull requests

2 participants