Closed zxin8580 closed 3 years ago
好的,相关功能可能会在2.0.0的beta的某个版本中加入,请留意commit和wiki更新
目前个人开发重心在 mcl-installer ,待该项目完善后(一两天),才会转来开发mirai native
哇,别说一两天,一两周也愿意等(。・`ω´・)
getStrangerInfo
已更新,编码如下,修改相关代码就可以获取多出来的qLevel
,email
和sign
了
fun getStrangerInfo(pluginId: Int, account: Long) = call("CQ_getStrangerInfo", pluginId, "") {
return@call runBlocking {
val profile = CacheManager.findUser(account)?.queryProfile()
?: Mirai.queryProfile(MiraiNative.bot, account)
return@runBlocking buildPacket {
writeLong(account)
writeString(profile.nickname)
writeInt(profile.sex.ordinal)
writeInt(profile.age)
writeInt(profile.qLevel)
writeString(profile.email)
writeString(profile.sign)
}.encodeBase64()
}
}
感谢大佬~
大佬,我昨天测试了一下member.queryProfile()好像会对getGroupMemberList()的执行效率有挺大影响,尝试注释掉并返回sex,age=0后效率恢复正常了
是的,mirai默认没有缓存这些数据,所以全部查询的话确实会很慢
特性描述 https://github.com/mamoe/mirai/issues/967#issue-801216225
请问mirai native能否考虑将此功能列入Mirai Native APIs供调用