Closed august-xu closed 4 years ago
监听失效,不进入join方法 日志如下: [20-05-26 22:26:29] [PicqBotX] [DEBUG(java.lang.Thread.run:748)] - 数据: {"group_id":xxxx,"notice_type":"group_increase","operator_id":xxxx,"post_type":"notice","self_id":xxx,"sub_type":"approve","time":1590503189,"user_id":xxx} 代码如下: @EventHandler private void join(EventNoticeGroupMemberIncrease event) {
System.out.println("进入群事件!"); IcqHttpApi httpApi = event.getHttpApi(); Long userid = event.getUserId(); Long groupId = event.getGroupId(); if (groupId == targetGroupId) { //event.getBot().getAccountManager().refreshCache(); String message = "xxxxx"; String raw = new MessageBuilder().add(new ComponentAt(userid)).add(message).toString(); httpApi.sendGroupMsg(groupId, raw); }
其他的事件都没问题嘛w? bot.getEventManager().registerListeners(...) 了嘛?
bot.getEventManager().registerListeners(...)
群聊私聊都没问题,注册了
好奇怪.... 改成监听 EventNoticeGroupMemberApprove 试试吧w
EventNoticeGroupMemberApprove
改成这个也不行囧
啊w 是不是你那个方法设成 private 了的问题呀w
还真是这个问题 囧
监听失效,不进入join方法 日志如下: [20-05-26 22:26:29] [PicqBotX] [DEBUG(java.lang.Thread.run:748)] - 数据: {"group_id":xxxx,"notice_type":"group_increase","operator_id":xxxx,"post_type":"notice","self_id":xxx,"sub_type":"approve","time":1590503189,"user_id":xxx} 代码如下: @EventHandler private void join(EventNoticeGroupMemberIncrease event) {