Interface AbstractThreadCreateAction<T, R extends AbstractThreadCreateAction<T,R>>

Type Parameters:
T - The success type given to the RestAction.queue(Consumer, Consumer) success consumer
R - The common return type of setters, allowing for fluid interface design
All Superinterfaces:
RestAction<T>
All Known Subinterfaces:
ForumPostAction, ThreadChannelAction

public interface AbstractThreadCreateAction<T, R extends AbstractThreadCreateAction<T,R>> extends RestAction<T>
Common features of all RestActions that create a new thread.
  • Method Details

    • getGuild

      @Nonnull Guild getGuild()
      The guild to create this GuildChannel for.
      Returns:
      The guild
    • getType

      @Nonnull ChannelType getType()
      The ChannelType for the resulting channel.
      Returns:
      The channel type
    • setName

      @Nonnull @CheckReturnValue R setName(@Nonnull String name)
      Sets the name for the new GuildChannel.
      Parameters:
      name - The not-null name for the new GuildChannel (up to 100 characters)
      Returns:
      The current action, for chaining convenience
      Throws:
      IllegalArgumentException - If the provided name is null, empty, or longer than 100 characters
    • setAutoArchiveDuration

      @Nonnull @CheckReturnValue R setAutoArchiveDuration(@Nonnull ThreadChannel.AutoArchiveDuration autoArchiveDuration)
      Sets the ThreadChannel.AutoArchiveDuration for the new thread.
      This is primarily used to hide threads after the provided time of inactivity. Threads are automatically archived after 7 days of inactivity regardless.
      Parameters:
      autoArchiveDuration - The new archive inactivity duration (which hides the thread)
      Returns:
      The current action, for chaining convenience
      Throws:
      IllegalArgumentException - If the provided duration is null
    • setSlowmode

      @Nonnull @CheckReturnValue R setSlowmode(int slowmode)
      Sets the slowmode for the new thread.

      A channel slowmode must not be negative nor greater than ISlowmodeChannel.MAX_SLOWMODE!

      Note: Bots are unaffected by this.
      Having MESSAGE_MANAGE or MANAGE_CHANNEL permission also grants immunity to slowmode.

      Parameters:
      slowmode - The new slowmode
      Returns:
      The current action, for chaining convenience
      Throws:
      InsufficientPermissionException - If the bot does not have Permission.MANAGE_THREADS in the parent channel
      IllegalArgumentException - If the provided slowmode is negative or greater than 21600
      See Also: