MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    收不到文件消息

    BUG反馈
    2
    5
    164
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      NAMEniubi last edited by

      在控制台能看见有事件进来了,但是不触发监听,在Listener打断点完全没动静

      1 Reply Last reply Reply Quote -1
      • Karlatemp
        Karlatemp last edited by

        提供复现代码并确定 listener 已注册并确定 debugger 已经连接上

        N 1 Reply Last reply Reply Quote 0
        • N
          NAMEniubi @Karlatemp last edited by

          @karlatemp

          public class RbootEventHandler extends SimpleListenerHost {
          
          
              @NotNull
              @EventHandler
              public ListeningStatus onMessage(@NotNull FriendMessageEvent event) {
                  MessageChain message = event.getMessage();
                  if (message.contains(FileMessage.Key)){
                      System.out.println("文件消息");
                  }
                  if (message.contains(Image.Key)){
                      System.out.println("图片消息");
                  }
                  if (message.contains(PlainText.Key)){
                      System.out.println("文字消息");
                  }
                  if (message.contains(Voice.Key)){
                      System.out.println("语音消息");
                  }
          
          
          
          
                  return ListeningStatus.LISTENING; 
              }
            }
          

          这是listener 代码,文字及图片消息正常接收处理,在控制台中有输出。但文件及语音没有,在第7行event.getMessage()处打断点也没有触发,这是maven工程,导入依赖为mirai-core-jvm 2.6.7

          1 Reply Last reply Reply Quote 0
          • Karlatemp
            Karlatemp last edited by

            2.6.7 不支持好友语音和好友文件

            N 1 Reply Last reply Reply Quote 0
            • N
              NAMEniubi @Karlatemp last edited by

              @karlatemp 升级到2.7-M2再次尝试,语音已经可以接收,文件消息依然没有任何动静。

              1 Reply Last reply Reply Quote 1
              • 1 / 1
              • First post
                Last post
              Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact