We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
如图,根据描述,At()调用contentToString()将被转化为"@群名片",但经过test发现实际转化的是"@qq",测试结果如下(测试代码贴在系统日志了):
可见无论是At.contentToString()或者At.content,返回字符串均为"@qq",要伪造假艾特字符串还是只能用"@"+group.getMember(MasterID)?.nameCardOrNick
test一下就好
2.13.0-M1
ANDROID_PAD
No response
suspend fun test5(group:Group,name:String="At(ID).content") { group.sendMessage("测试${name}开始") group.sendMessage(At(MasterID)) group.sendMessage(At(MasterID).content) group.sendMessage(At(MasterID).contentToString()) group.sendMessage("@"+group.getMember(MasterID)?.nameCardOrNick) group.sendMessage("测试${name}完毕") }
The text was updated successfully, but these errors were encountered:
At本身就只存了被at的人的qq号,你还想 contentToString 能取到群名片就是奢望。
要获取与QQ客户端类似的格式应当用At.getDisplay(Group)
At.getDisplay(Group)
Sorry, something went wrong.
我也觉得这不可能,所以才说这个注释有误
At本身就只存了被at的人的qq号,你还想 contentToString 能取到群名片就是奢望。 要获取与QQ客户端类似的格式应当用At.getDisplay(Group)
一定条件下是可以的 例如 MessageChain 里的 At 可以根据 MessageSource 获取上下文(群) 然后 转成群名片
MessageChain
At
MessageSource
单个 At 当然不行
文档确实有问题
Successfully merging a pull request may close this issue.
问题描述
如图,根据描述,At()调用contentToString()将被转化为"@群名片",但经过test发现实际转化的是"@qq",测试结果如下(测试代码贴在系统日志了):

可见无论是At.contentToString()或者At.content,返回字符串均为"@qq",要伪造假艾特字符串还是只能用"@"+group.getMember(MasterID)?.nameCardOrNick
复现
test一下就好
mirai-core 版本
2.13.0-M1
bot-protocol
ANDROID_PAD
其他组件版本
No response
系统日志
网络日志
No response
补充信息
No response
The text was updated successfully, but these errors were encountered: