use of io.discloader.discloader.network.json.VoiceRegionJSON in project DiscLoader by R3alCl0ud.
the class Guild method getVoiceRegions.
@Override
public CompletableFuture<List<VoiceRegion>> getVoiceRegions() {
CompletableFuture<List<VoiceRegion>> future = new CompletableFuture<List<VoiceRegion>>();
CompletableFuture<VoiceRegionJSON[]> cf = getLoader().rest.request(Methods.GET, Endpoints.guildRegions(getID()), new RESTOptions(), VoiceRegionJSON[].class);
cf.thenAcceptAsync(regions -> {
List<VoiceRegion> rgs = new ArrayList<>();
for (VoiceRegionJSON region : regions) {
rgs.add(new VoiceRegion(region));
}
future.complete(rgs);
});
return future;
}
Aggregations