Skip to content

Commit

Permalink
Make breaking channel hierarchy changes (Discord4J#960)
Browse files Browse the repository at this point in the history
* Modify channel hierarchy in preparation for threads

* Use 'TopLevel' names instead of temp names, remove duplicate docs

* Add deprecation docs

* Add class docs

* Make CategorizableChannel extend TopLevelGuildChannel

* Make breaking channel hierarchy changes

* (Re)move methods deprecated in preparation for threads
* Move most base channel method implementations to default methods
* Remove most base channel classes

* Don't deprecate GuildChannel#getEffectivePermissions

* Remove BaseTopLevelGuildChannel, add license headers, docs

* Remove unused imports

* Remove unused imports

Co-authored-by: quanticc <abarcab.ivan@gmail.com>
  • Loading branch information
2 people authored and skykatik committed Oct 3, 2021
1 parent 39dc562 commit 3be8891
Show file tree
Hide file tree
Showing 22 changed files with 493 additions and 1,275 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,24 @@
*/
package discord4j.core.object.entity.channel;

import discord4j.common.util.Snowflake;
import discord4j.core.GatewayDiscordClient;
import discord4j.core.util.EntityUtil;
import discord4j.discordjson.json.ChannelData;
import discord4j.core.GatewayDiscordClient;
import discord4j.common.util.Snowflake;
import discord4j.rest.entity.RestChannel;
import reactor.core.publisher.Mono;
import reactor.util.annotation.Nullable;

import java.util.Objects;

/** An internal implementation of {@link Channel} designed to streamline inheritance. */
class BaseChannel implements Channel {

/** The raw data as represented by Discord. */
private final ChannelData data;

/** The gateway associated to this object. */
private final GatewayDiscordClient gateway;

/** The raw data as represented by Discord. */
private final ChannelData data;

/** A handle to execute REST API operations for this entity. */
private final RestChannel rest;

Expand All @@ -56,31 +55,12 @@ public final GatewayDiscordClient getClient() {
}

@Override
public final Snowflake getId() {
return Snowflake.of(data.id());
}

@Override
public RestChannel getRestChannel() {
public final RestChannel getRestChannel() {
return rest;
}

@Override
public final Type getType() {
return Type.of(data.type());
}

@Override
public final Mono<Void> delete(@Nullable final String reason) {
return rest.delete(reason);
}

/**
* Gets the raw data as represented by Discord.
*
* @return The raw data as represented by Discord.
*/
ChannelData getData() {
public final ChannelData getData() {
return data;
}

Expand Down

This file was deleted.

Loading

0 comments on commit 3be8891

Please sign in to comment.