mirai icon indicating copy to clipboard operation
mirai copied to clipboard

Command的子指令使用Member类参数无法对应群聊中发送的QQ号

Open pilgrim773 opened this issue 3 years ago • 1 comments

问题描述

@SubCommand("禁言") public void mute(CommandSender sender, Member target, int duration) 在主指令里,使用上面的方法签名定义了一个禁言子指令,在群聊里聊天时第一个参数使用QQ号或者@群员均被提示:

参数不匹配, 你是否想执行: 天之声 禁言 (参数类型错误)

但是文档里说智能参数解析可以允许这样使用

复现

1.群聊内发送 /天之声 禁言 1625581456 60,提示参数不匹配, 你是否想执行: /天之声 禁言 arg1 arg2 (参数类型错误) 2.群聊内发送 /天之声 禁言 @GGK 120,提示参数不匹配, 你是否想执行: /天之声 禁言 arg1 arg2 (参数类型错误)

mirai-core 版本

2.13.4

bot-protocol

ANDROID_PHONE

其他组件版本

No response

系统日志

No response

网络日志

No response

补充信息

No response

pilgrim773 avatar Feb 11 '23 14:02 pilgrim773

image

我写的 kotlin 插件没有问题 这可能是 mirai 解析 Java 方法带来的问题?

cssxsh avatar Feb 11 '23 14:02 cssxsh