Search in sources :

Example 1 with Overwrite

use of io.discloader.discloader.core.entity.Overwrite in project DiscLoader by R3alCl0ud.

the class GuildChannel method deleteOverwrite.

// @Override
// public CompletableFuture<IGuildChannel> clone() {
// return guild.createTextChannel(name);
// }
@Override
public CompletableFuture<IOverwrite> deleteOverwrite(IOverwrite overwrite) {
    CompletableFuture<IOverwrite> future = new CompletableFuture<>();
    loader.rest.request(Methods.DELETE, Endpoints.channelOverwrite(getID(), overwrite.getID()), new RESTOptions(), Void.class).thenAcceptAsync(n -> {
        future.complete(overwrite);
    }).exceptionally(ex -> {
        future.completeExceptionally(ex);
        return null;
    });
    return future;
}
Also used : Endpoints(io.discloader.discloader.network.util.Endpoints) IChannel(io.discloader.discloader.entity.channel.IChannel) Methods(io.discloader.discloader.network.util.Methods) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) IPermission(io.discloader.discloader.entity.IPermission) ArrayList(java.util.ArrayList) SnowflakeUtil(io.discloader.discloader.entity.util.SnowflakeUtil) IGuildChannel(io.discloader.discloader.entity.channel.IGuildChannel) JSONObject(org.json.JSONObject) Map(java.util.Map) Permission(io.discloader.discloader.core.entity.Permission) IGuild(io.discloader.discloader.entity.guild.IGuild) EventListenerAdapter(io.discloader.discloader.common.event.EventListenerAdapter) FetchInvites(io.discloader.discloader.network.rest.actions.channel.FetchInvites) Role(io.discloader.discloader.core.entity.guild.Role) IGuildMember(io.discloader.discloader.entity.guild.IGuildMember) SetOverwrite(io.discloader.discloader.network.rest.actions.channel.SetOverwrite) CloseGuildChannel(io.discloader.discloader.network.rest.actions.channel.close.CloseGuildChannel) IOverwrite(io.discloader.discloader.entity.IOverwrite) RESTOptions(io.discloader.discloader.network.rest.RESTOptions) IRole(io.discloader.discloader.entity.guild.IRole) Permissions(io.discloader.discloader.entity.util.Permissions) EntityBuilder(io.discloader.discloader.common.registry.EntityBuilder) List(java.util.List) Guild(io.discloader.discloader.core.entity.guild.Guild) PermissionsException(io.discloader.discloader.common.exceptions.PermissionsException) IInvite(io.discloader.discloader.entity.invite.IInvite) ChannelJSON(io.discloader.discloader.network.json.ChannelJSON) GuildChannelUpdateEvent(io.discloader.discloader.common.event.channel.GuildChannelUpdateEvent) Overwrite(io.discloader.discloader.core.entity.Overwrite) IChannelCategory(io.discloader.discloader.entity.channel.IChannelCategory) EntityRegistry(io.discloader.discloader.common.registry.EntityRegistry) CompletableFuture(java.util.concurrent.CompletableFuture) RESTOptions(io.discloader.discloader.network.rest.RESTOptions) IOverwrite(io.discloader.discloader.entity.IOverwrite)

Aggregations

EventListenerAdapter (io.discloader.discloader.common.event.EventListenerAdapter)1 GuildChannelUpdateEvent (io.discloader.discloader.common.event.channel.GuildChannelUpdateEvent)1 PermissionsException (io.discloader.discloader.common.exceptions.PermissionsException)1 EntityBuilder (io.discloader.discloader.common.registry.EntityBuilder)1 EntityRegistry (io.discloader.discloader.common.registry.EntityRegistry)1 Overwrite (io.discloader.discloader.core.entity.Overwrite)1 Permission (io.discloader.discloader.core.entity.Permission)1 Guild (io.discloader.discloader.core.entity.guild.Guild)1 Role (io.discloader.discloader.core.entity.guild.Role)1 IOverwrite (io.discloader.discloader.entity.IOverwrite)1 IPermission (io.discloader.discloader.entity.IPermission)1 IChannel (io.discloader.discloader.entity.channel.IChannel)1 IChannelCategory (io.discloader.discloader.entity.channel.IChannelCategory)1 IGuildChannel (io.discloader.discloader.entity.channel.IGuildChannel)1 IGuild (io.discloader.discloader.entity.guild.IGuild)1 IGuildMember (io.discloader.discloader.entity.guild.IGuildMember)1 IRole (io.discloader.discloader.entity.guild.IRole)1 IInvite (io.discloader.discloader.entity.invite.IInvite)1 Permissions (io.discloader.discloader.entity.util.Permissions)1 SnowflakeUtil (io.discloader.discloader.entity.util.SnowflakeUtil)1