wechaty / java-wechaty-getting-started

Java Wechaty Starter Project Template that Works Out-of-the-Box
https://gitpod.io/#https://github.com/wechaty/java-wechaty-getting-started
Apache License 2.0
46 stars 41 forks source link

Unable to listen to group chat joining information #21

Closed wtl01 closed 4 years ago

wtl01 commented 4 years ago
   /**
     * 监听群聊加入
     */
    bot.on("RoomJoin",(RoomJoinListener) (room, list, contact, date) -> {
        String message = "欢迎";
        list.forEach(item-> System.out.println(item.getAlias()));
        room.say(message,list);
    });
diaozxin007 commented 4 years ago

try modify “RoomJoin” to “room-join”. we will use enum to replace the string in next version.

huan commented 4 years ago

Awesome, enum will help developers to make sure the they are not using the wrong event names.

One question: can Java use the same event name as the TS with the enum values?

It would be great if we can always to keep the names the same as the TS.

wtl01 commented 4 years ago

@huan if it same with ts ,will help with development

wtl01 commented 4 years ago

I changed the code RoomJoin to room-join, but this event will cause the robot to fail to receive group chat messages

diaozxin007 commented 4 years ago

@wangtianlei001 plz try new api