Interface GuildWelcomeScreenManager

All Superinterfaces:
AuditableRestAction<Void>, Manager<GuildWelcomeScreenManager>, RestAction<Void>

public interface GuildWelcomeScreenManager extends Manager<GuildWelcomeScreenManager>
Manager providing functionality to update one or more fields for a GuildWelcomeScreen.

Example

manager.setEnabled(false)
       .setDescription(null)
       .setWelcomeChannels()
       .queue();
manager.setEnabled(true)
       .setDescription("Bot desc")
       .setWelcomeChannels(Arrays.asList(
               GuildWelcomeScreen.Channel.of(rulesChannel, "Read the rules first"),
               GuildWelcomeScreen.Channel.of(generalChannel, "Go have a chat", Emoji.fromUnicode("U+1F4AC"))
       ))
       .queue();
See Also:
  • Field Details

    • ENABLED

      static final long ENABLED
      Used to reset the enabled field
      See Also:
    • DESCRIPTION

      static final long DESCRIPTION
      Used to reset the description field
      See Also:
    • CHANNELS

      static final long CHANNELS
      Used to reset the channels field
      See Also:
  • Method Details

    • getGuild

      @Nonnull Guild getGuild()
      The Guild this Manager's GuildWelcomeScreen is in.
      Returns:
      The parent Guild
    • reset

      @Nonnull @CheckReturnValue GuildWelcomeScreenManager reset(long fields)
      Resets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
      Example: manager.reset(GuildWelcomeScreenManager.DESCRIPTION | GuildWelcomeScreenManager.CHANNELS);

      Flag Constants:

      Specified by:
      reset in interface Manager<GuildWelcomeScreenManager>
      Parameters:
      fields - Integer value containing the flags to reset.
      Returns:
      GuildWelcomeScreenManager for chaining convenience
    • reset

      @Nonnull @CheckReturnValue GuildWelcomeScreenManager reset(@Nonnull long... fields)
      Resets the specified fields.
      Example: manager.reset(GuildWelcomeScreenManager.DESCRIPTION, GuildWelcomeScreenManager.CHANNELS);

      Flag Constants:

      Specified by:
      reset in interface Manager<GuildWelcomeScreenManager>
      Parameters:
      fields - Integer value containing the flags to reset.
      Returns:
      GuildWelcomeScreenManager for chaining convenience
    • setEnabled

      @Nonnull @CheckReturnValue GuildWelcomeScreenManager setEnabled(boolean enabled)
      Sets the enabled state of the welcome screen.
      Parameters:
      enabled - True if the welcome screen should be enabled
      Returns:
      GuildWelcomeScreenManager for chaining convenience
    • setDescription

      @Nonnull @CheckReturnValue GuildWelcomeScreenManager setDescription(@Nullable String description)
      Sets the description of the welcome screen.

      The description must not be longer than 140

      Parameters:
      description - The new description of the welcome screen, or null to remove the description
      Returns:
      GuildWelcomeScreenManager for chaining convenience
      Throws:
      IllegalArgumentException - If the description longer than 140
    • getWelcomeChannels

      @Nonnull @Unmodifiable List<GuildWelcomeScreen.Channel> getWelcomeChannels()
      Returns an immutable list of the welcome channels
      These channels are those which are being modified, not the ones currently shown on Discord
      Returns:
      An immutable list of the welcome channels to be set by the manager
    • clearWelcomeChannels

      @Nonnull @CheckReturnValue GuildWelcomeScreenManager clearWelcomeChannels()
      Removes all welcome channels.
      Returns:
      GuildWelcomeScreenManager for chaining convenience
    • setWelcomeChannels

      @Nonnull @CheckReturnValue GuildWelcomeScreenManager setWelcomeChannels(@Nonnull Collection<? extends GuildWelcomeScreen.Channel> channels)
      Sets the welcome channels of the welcome screen.

      The order of the Collection defines in what order the channels appear on Discord.

      Parameters:
      channels - The new welcome channels to use, can be an empty list to remove all welcome channels.
      Returns:
      GuildWelcomeScreenManager for chaining convenience
      Throws:
      IllegalArgumentException -
      • If channels is null
      • If more than 5 welcome channels are set
      See Also:
    • setWelcomeChannels

      @Nonnull @CheckReturnValue default GuildWelcomeScreenManager setWelcomeChannels(@Nonnull GuildWelcomeScreen.Channel... channels)
      Sets the welcome channels of the welcome screen.

      The order of the parameters defines in what order the channels appear on Discord.

      Parameters:
      channels - The new welcome channels to use, you can provide nothing in order to remove all welcome channels.
      Returns:
      GuildWelcomeScreenManager for chaining convenience
      Throws:
      IllegalArgumentException -
      • If channels is null
      • If more than 5 welcome channels are set
      See Also: