MiraiForum

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

    jiajiaxd 创建的主题

    • J

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

      2
      0
      赞同
      2
      帖子
      243
      浏览

      J

      如何通过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

      3
      0
      赞同
      3
      帖子
      250
      浏览

      J

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

    • 1 / 1