Interface ChannelManager<T extends GuildChannel,M extends ChannelManager<T,M>>

All Superinterfaces:
AuditableRestAction<Void>, Manager<M>, RestAction<Void>
All Known Subinterfaces:
AudioChannelManager<T,M>, BaseGuildMessageChannelManager<T,M>, CategoryManager, ICategorizableChannelManager<T,M>, IPermissionContainerManager<T,M>, IPositionableChannelManager<T,M>, NewsChannelManager, StageChannelManager, StoreChannelManager, TextChannelManager, ThreadChannelManager, VoiceChannelManager

public interface ChannelManager<T extends GuildChannel,M extends ChannelManager<T,M>> extends Manager<M>
Manager providing functionality to update one or more fields for a GuildChannel.

Example


 manager.setName("github-log")
        .setTopic("logs for github commits")
        .setNSFW(false)
        .queue();
 manager.reset(ChannelManager.PARENT | ChannelManager.NAME)
        .setName("nsfw-commits")
        .queue();
 manager.setTopic("Java is to Javascript as wall is to wallet")
        .queue();
 
See Also:
  • Field Details

  • Method Details

    • reset

      @Nonnull M 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(ChannelManager.NAME | ChannelManager.PARENT);

      Flag Constants:

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

      @Nonnull M reset(long... fields)
      Resets the fields specified by the provided bit-flag patterns.
      Example: manager.reset(ChannelManager.NAME, ChannelManager.PARENT);

      Flag Constants:

      Specified by:
      reset in interface Manager<T extends GuildChannel>
      Parameters:
      fields - Integer values containing the flags to reset.
      Returns:
      ChannelManager for chaining convenience
    • getChannel

      @Nonnull T getChannel()
      The GuildChannel that will be modified by this Manager instance
      Returns:
      The GuildChannel
    • getGuild

      @Nonnull default Guild getGuild()
      The Guild this Manager's GuildChannel is in.
      This is logically the same as calling getChannel().getGuild()
      Returns:
      The parent Guild
    • setName

      Sets the name of the selected GuildChannel.

      A channel name must not be null nor empty or more than 100 characters long!
      TextChannel names may only be populated with alphanumeric (with underscore and dash).

      Example: mod-only or generic_name
      Characters will automatically be lowercased by Discord for text channels!

      Parameters:
      name - The new name for the selected GuildChannel
      Returns:
      ChannelManager for chaining convenience
      Throws:
      IllegalArgumentException - If the provided name is null or not between 1-100 characters long