Class Category

java.lang.Object
discord4j.core.object.entity.channel.Category
All Implemented Interfaces:
DiscordObject, Channel, GuildChannel, TopLevelGuildChannel, Entity

public final class Category extends Object
A Discord category.
  • Constructor Details

    • Category

      public Category(GatewayDiscordClient gateway, discord4j.discordjson.json.ChannelData data)
      Constructs an Category with an associated GatewayDiscordClient and Discord data.
      Parameters:
      gateway - The GatewayDiscordClient associated to this object, must be non-null.
      data - The raw data as represented by Discord, must be non-null.
  • Method Details

    • getChannels

      public Flux<CategorizableChannel> getChannels()
      Requests to retrieve the channels residing in this category.
      Returns:
      A Flux that continually emits the channels residing in this category. If an error is received, it is emitted through the Flux.
    • getChannels

      public Flux<CategorizableChannel> getChannels(EntityRetrievalStrategy retrievalStrategy)
      Requests to retrieve the channels residing in this category, using the given retrieval strategy.
      Parameters:
      retrievalStrategy - the strategy to use to get the channels
      Returns:
      A Flux that continually emits the channels residing in this category. If an error is received, it is emitted through the Flux.
    • edit

      Deprecated.
      use edit(CategoryEditSpec) or edit() which offer an immutable approach to build specs
      Requests to edit this category.
      Parameters:
      spec - A Consumer that provides a "blank" LegacyCategoryEditSpec to be operated on.
      Returns:
      A Mono where, upon successful completion, emits the edited Category. If an error is received, it is emitted through the Mono.
    • edit

      public discord4j.core.spec.CategoryEditMono edit()
      Requests to edit this category. Properties specifying how to edit this category can be set via the withXxx methods of the returned CategoryEditMono.
      Returns:
      A CategoryEditMono where, upon successful completion, emits the edited Category. If an error is received, it is emitted through the CategoryEditMono.
    • edit

      public Mono<Category> edit(discord4j.core.spec.CategoryEditSpec spec)
      Requests to edit this category.
      Parameters:
      spec - an immutable object specifying how to edit this category
      Returns:
      A Mono where, upon successful completion, emits the edited Category. If an error is received, it is emitted through the Mono.
    • toString

      public String toString()
    • getEffectivePermissions

      public Mono<PermissionSet> getEffectivePermissions(Snowflake memberId)
      Description copied from interface: GuildChannel
      Gets the permissions for the given member, taking into account permission overwrites in this channel.
      Specified by:
      getEffectivePermissions in interface GuildChannel
      Parameters:
      memberId - The ID of the member to get permissions for.
      Returns:
      The permissions for the given member.
    • getEffectivePermissions

      public Mono<PermissionSet> getEffectivePermissions(Member member)
      Description copied from interface: GuildChannel
      Gets the permissions for the given member, taking into account permission overwrites in this channel.
      Specified by:
      getEffectivePermissions in interface GuildChannel
      Parameters:
      member - The member to get permissions for.
      Returns:
      The permissions for the given member.
    • getClient

      public final GatewayDiscordClient getClient()
      Description copied from interface: DiscordObject
      Returns the GatewayDiscordClient that created this object. Methods in it are exclusively based on the entity cache or Store in use. Refer to calling getClient().rest() to access a DiscordClient that is capable of requesting entities directly from the REST API.
      Specified by:
      getClient in interface DiscordObject
      Returns:
      The GatewayDiscordClient associated to this object.
    • getRestChannel

      public final RestChannel getRestChannel()
      Description copied from interface: Channel
      Return a RestChannel handle to execute REST API operations on this entity.
      Specified by:
      getRestChannel in interface Channel
    • getData

      public final discord4j.discordjson.json.ChannelData getData()
      Description copied from interface: Channel
      Gets the raw data as represented by Discord.
      Specified by:
      getData in interface Channel
      Returns:
      The raw data as represented by Discord.
    • equals

      public final boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object