use of org.javacord.core.event.server.member.ServerMemberJoinEventImpl in project Javacord by BtoBastian.
the class GuildMemberAddHandler method handle.
@Override
public void handle(JsonNode packet) {
api.getPossiblyUnreadyServerById(packet.get("guild_id").asLong()).map(server -> (ServerImpl) server).ifPresent(server -> {
MemberImpl member = server.addMember(packet);
server.incrementMemberCount();
User user = new UserImpl(api, packet.get("user"), member, server);
ServerMemberJoinEvent event = new ServerMemberJoinEventImpl(server, user);
api.getEventDispatcher().dispatchServerMemberJoinEvent(server, server, user, event);
});
}
Aggregations