Class ForumChannel

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

@Experimental public final class ForumChannel extends Object implements CategorizableChannel
A Discord guild channel that contains organized threads with labels.
  • Constructor Details

    • ForumChannel

      public ForumChannel(GatewayDiscordClient gateway, discord4j.discordjson.json.ChannelData data)
  • Method Details

    • getTopic

      public Optional<String> getTopic()
      Gets the topic for this guild forum.
      Returns:
      the user defined topic for this guild forum channel (0-4096 characters).
    • isNsfw

      public boolean isNsfw()
      Gets whether this channel is considered NSFW (Not Safe For Work).
      Returns:
      true if this channel is considered NSFW (Not Safe For Work), false otherwise.
    • getFlags

      public EnumSet<Channel.Flag> getFlags()
      Gets the channels Channel.Flag associated to this forum channel Unknown flags are currently ignored.
      Returns:
      An EnumSet representing the known flags for this forum channel.
    • getDefaultAutoArchiveDuration

      public Optional<Integer> getDefaultAutoArchiveDuration()
      Gets the default auto archive duration for threads in this forum channel
      Returns:
      Default client auto archive duration in minutes wrapped in an Optional object
    • getAvailableTags

      public List<ForumTag> getAvailableTags()
      Gets the available forum tags for this forum channel
      Returns:
      A list containing every available forum tag for this channel
    • getDefaultReaction

      public Optional<DefaultReaction> getDefaultReaction()
      Gets the default emoji to add in a reaction button on a thread for this forum channel
      Returns:
      An Optional that may contain the DefaultReaction emoji
    • getDefaultThreadRateLimitPerUser

      public Optional<Integer> getDefaultThreadRateLimitPerUser()
      Gets the default thread rate limit duration per user. This field is copied into a created thread and is not updated on the fly.
      Returns:
      The initial rate limit per user for newly created threads
    • getSortOrder

      public Optional<ForumChannel.SortOrder> getSortOrder()
      Gets the default associated ForumChannel.SortOrder for this forum channel
      Returns:
      The ForumChannel.SortOrder, wrapped in an Optional
    • getDefaultForumLayout

      public ForumChannel.LayoutType getDefaultForumLayout()
      Gets the associated ForumChannel.LayoutType for this Forum channel
      Returns:
      The associated ForumChannel.LayoutType
    • startThread

      public Mono<ThreadChannel> startThread(discord4j.core.spec.StartThreadInForumChannelSpec request)
      Starts a new ThreadChannel in this forum channel
      Parameters:
      request - an immutable object that specifies how to create the thread
      Returns:
      A Mono that, upon completion, emits a ThreadChannel object
    • edit

      public Mono<ForumChannel> edit(discord4j.core.spec.ForumChannelEditSpec spec)
      Requests to edit the current forum channel object
      Parameters:
      spec - an immutable object that specifies the modifications requested
      Returns:
      A Mono that, upon completion, emits the updated ForumChannel object
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object