use of org.javacord.core.event.server.member.ServerMembersChunkEventImpl in project Javacord by BtoBastian.
the class GuildMembersChunkHandler method handle.
@Override
public void handle(JsonNode packet) {
api.getPossiblyUnreadyServerById(packet.get("guild_id").asLong()).map(ServerImpl.class::cast).ifPresent(server -> {
List<Member> members = server.addAndGetMembers(packet.get("members"));
ServerMembersChunkEventImpl event = new ServerMembersChunkEventImpl(server, members.stream().map(Member::getUser).collect(Collectors.toList()));
api.getEventDispatcher().dispatchServerMembersChunkEvent(server, server, event);
});
}
Aggregations