simple-robot / simbot-component-mirai

simple-robot下的mirai组件
https://component-mirai.simbot.forte.love/
GNU Affero General Public License v3.0
20 stars 0 forks source link

试图获取MiraiGroupMessageRecallEvent监听的的被撤回消息内容失败 #60

Closed gaoxinke88888888 closed 2 years ago

gaoxinke88888888 commented 2 years ago

使用MiraiGroupMessageRecallEvent监听消息撤回事件能够成功监听,但是我试图获取被撤回的消息内容时为空,是否是没有打开消息缓存导致的?如果是的话请问如何打开。

ForteScarlet commented 2 years ago

如果是使用的 boot,即通过 *.bot 文件配置,则增加配置项config.recallMessageCacheStrategy=MEMORY_LRU

{
   "component": "simbot.mirai",
   "code": 123456,
   "password": "xxxxxx",
   "config": {
        "recallMessageCacheStrategy": "MEMORY_LRU"
   }
}

如果使用的核心模式,使用属性 recallCacheStrategy = MemoryLruMiraiRecallMessageCacheStrategy()

val bot = register(
                code = 12345678,
                password = "password",
                createMiraiBotConfiguration {
                    recallCacheStrategy = MemoryLruMiraiRecallMessageCacheStrategy()
                }
            )
bot.start()
// ....

在 #39 之后有效。参考 v3.0.0.0.preview.10.0

gaoxinke88888888 commented 2 years ago

thank you very much