use of org.javacord.core.event.server.member.ServerMemberBanEventImpl in project Javacord by BtoBastian.
the class GuildBanAddHandler method handle.
@Override
public void handle(JsonNode packet) {
api.getPossiblyUnreadyServerById(packet.get("guild_id").asLong()).map(server -> (ServerImpl) server).ifPresent(server -> {
User user = new UserImpl(api, packet.get("user"), (MemberImpl) null, server);
server.removeMember(user.getId());
ServerMemberBanEvent event = new ServerMemberBanEventImpl(server, user);
api.getEventDispatcher().dispatchServerMemberBanEvent(server, server, user, event);
});
}
Aggregations