MiraiForum

    • 注册
    • 登录
    • 搜索
    • 热门
    • 最新
    • 未解决
    • 标签
    • 群组
    • 友情链接
    1. 主页
    2. jiajiaxd
    J
    • 资料
    • 关注 0
    • 粉丝 0
    • 主题 2
    • 帖子 4
    • 最佳 0
    • 有争议的 0
    • 群组 0

    jiajiaxd

    @jiajiaxd

    0
    声望
    1
    资料浏览
    4
    帖子
    0
    粉丝
    0
    关注
    注册时间 最后登录

    jiajiaxd 取消关注 关注

    jiajiaxd 发布的最新帖子

    • RE: 如何获取一个陌生人的QQ等级?

      已经解决
      https://github.com/mamoe/mirai/issues/1483
      // Java
      Mirai.getInstance().queryProfile

      // Kotlin
      Mirai.queryProfile

      jiajiaxd created this issue in mamoe/mirai

      closed 建议允许通过MemberJoinRequestEvent事件来获取申请人的详细资料 #1483

      发布在 开发交流
      J
      jiajiaxd
    • 如何获取一个陌生人的QQ等级?

      如何通过QQ号获取一个陌生人(对方从未发过消息)的QQ等级?
      我想通过此方法来判断申请进群的人等级是否大于指定值,避免小号。
      我尝试使用此方法:

      getCurrentBot().getStranger(event.getFromId()).queryProfile().getQLevel()
      

      但是会报错:

      2021-08-17 16:02:25 E/main: Exception in coroutine <unnamed>
      java.lang.NullPointerException: Cannot invoke "net.mamoe.mirai.contact.Stranger.queryProfile()" because the return value of "net.mamoe.mirai.Bot.getStranger(long)" is null
              at com.jiajiaxd.EventHandler.lambda$new$3(EventHandler.java:241)
              at net.mamoe.mirai.event.EventChannel$subscribeAlways$2$1.invoke(EventChannel.kt:511)
              at net.mamoe.mirai.event.EventChannel$subscribeAlways$2$1.invoke(EventChannel.kt:60)
              at kotlinx.coroutines.InterruptibleKt.runInterruptibleInExpectedContext(Interruptible.kt:46)
              at kotlinx.coroutines.InterruptibleKt.access$runInterruptibleInExpectedContext(Interruptible.kt:1)
              at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invokeSuspend(Interruptible.kt:38)
              at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
              at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
              at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
              at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
              at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
              at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
      
      发布在 开发交流
      J
      jiajiaxd
    • RE: 我想问一下有没有群文件上传事件?

      感谢

      发布在 开发交流
      J
      jiajiaxd
    • 我想问一下有没有群文件上传事件?

      我在Mirai的事件列表里没有看见群文件上传事件。是没有吗,还是要通过别的方式进行监听。

      发布在 开发交流
      J
      jiajiaxd