Skip to content

请问有办法撤回引用回复的消息吗? #112

Answered by ForteScarlet
ikaros143 asked this question in Q&A
Discussion options

You must be logged in to vote

消息引用 类型的消息:https://docs.simbot.forte.love/components/mirai/simbot-component-mirai-core/love.forte.simbot.component.mirai.message/-mirai-quote-reply/index.html

至于撤回它,直接使用mirai原生的API:

// 得到 '消息引用'
MiraiQuoteReply miraiQuoteReply = groupMessageEvent.getMessageContent().getMessages().getFirstOrNull(MiraiQuoteReply.Key);
if (miraiQuoteReply == null) {
    // TODO if null
    return;
}
// 直接使用mirai的api
MessageSource source = miraiQuoteReply.getOriginalMiraiMessage().getSource();
MessageSource.recall(source);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ikaros143
Comment options

Answer selected by ForteScarlet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
组件:mirai 与mirai组件有关的内容
2 participants