Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* This file is part of Discord4J.
*
* Discord4J is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Discord4J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Discord4J. If not, see .
*/
package discord4j.rest.entity;
import discord4j.discordjson.json.*;
import discord4j.rest.RestClient;
import discord4j.rest.util.PaginationUtil;
import discord4j.rest.util.Snowflake;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.util.annotation.Nullable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
public class RestGuild {
private final RestClient restClient;
private final long id;
private RestGuild(RestClient restClient, long id) {
this.restClient = restClient;
this.id = id;
}
public static RestGuild create(RestClient restClient, Snowflake id) {
return new RestGuild(restClient, id.asLong());
}
public static RestGuild create(RestClient restClient, long id) {
return new RestGuild(restClient, id);
}
public Mono getData() {
return restClient.getGuildService().getGuild(id);
}
public RestEmoji emoji(long emojiId) {
return RestEmoji.create(restClient, id, emojiId);
}
public RestMember member(long memberId) {
return RestMember.create(restClient, id, memberId);
}
public RestRole role(long roleId) {
return RestRole.create(restClient, id, roleId);
}
public Mono modify(GuildModifyRequest request, @Nullable String reason) {
return restClient.getGuildService().modifyGuild(id, request, reason);
}
public Mono delete() {
return restClient.getGuildService().deleteGuild(id);
}
public Flux getChannels() {
return restClient.getGuildService().getGuildChannels(id);
}
public Mono createChannel(ChannelCreateRequest request, @Nullable String reason) {
return restClient.getGuildService().createGuildChannel(id, request, reason);
}
public Flux modifyChannelPositions(List requests) {
return restClient.getGuildService()
.modifyGuildChannelPositions(id, requests.toArray(new PositionModifyRequest[0]));
}
public Mono getMember(long userId) {
return restClient.getGuildService().getGuildMember(id, userId);
}
public Flux getMembers() {
Function