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 aGuildChannel.Example
manager.setName("github-log") .setTopic("logs for github commits") .setNSFW(false) .queue(); manager.reset(ChannelManager.TOPIC | ChannelManager.NAME) .setName("nsfw-commits") .setTopic(null) .setNSFW(true) .queue();- See Also:
GuildChannel.getManager()
-
-
Field Summary
Fields Modifier and Type Field Description static longARCHIVEDUsed to reset the archived fieldstatic longAUTO_ARCHIVE_DURATIONUsed to reset the auto-archive-duration fieldstatic longBITRATEUsed to reset the bitrate fieldstatic longINVITEABLEUsed to reset the invitable fieldstatic longLOCKEDUsed to reset the locked fieldstatic longNAMEUsed to reset the name fieldstatic longNSFWUsed to reset the nsfw fieldstatic longPARENTUsed to reset the parent fieldstatic longPERMISSIONUsed to reset the permission fieldstatic longPOSITIONUsed to reset the position fieldstatic longREGIONUsed to reset the region fieldstatic longSLOWMODEUsed to reset the rate-limit per user fieldstatic longTOPICUsed to reset the topic fieldstatic longTYPEUsed to reset the channel type fieldstatic longUSERLIMITUsed to reset the userlimit field
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description TgetChannel()TheGuildChannelthat will be modified by this Manager instancedefault GuildgetGuild()TheGuildthis Manager'sGuildChannelis in.Mreset(long fields)Resets the fields specified by the provided bit-flag pattern.Mreset(long... fields)Resets the fields specified by the provided bit-flag patterns.MsetName(String name)Sets the name of the selectedGuildChannel.-
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
-
Methods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeout
-
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
-
-
-
Field Detail
-
NAME
static final long NAME
Used to reset the name field- See Also:
- Constant Field Values
-
PARENT
static final long PARENT
Used to reset the parent field- See Also:
- Constant Field Values
-
TOPIC
static final long TOPIC
Used to reset the topic field- See Also:
- Constant Field Values
-
POSITION
static final long POSITION
Used to reset the position field- See Also:
- Constant Field Values
-
NSFW
static final long NSFW
Used to reset the nsfw field- See Also:
- Constant Field Values
-
USERLIMIT
static final long USERLIMIT
Used to reset the userlimit field- See Also:
- Constant Field Values
-
BITRATE
static final long BITRATE
Used to reset the bitrate field- See Also:
- Constant Field Values
-
PERMISSION
static final long PERMISSION
Used to reset the permission field- See Also:
- Constant Field Values
-
SLOWMODE
static final long SLOWMODE
Used to reset the rate-limit per user field- See Also:
- Constant Field Values
-
TYPE
static final long TYPE
Used to reset the channel type field- See Also:
- Constant Field Values
-
REGION
static final long REGION
Used to reset the region field- See Also:
- Constant Field Values
-
AUTO_ARCHIVE_DURATION
static final long AUTO_ARCHIVE_DURATION
Used to reset the auto-archive-duration field- See Also:
- Constant Field Values
-
ARCHIVED
static final long ARCHIVED
Used to reset the archived field- See Also:
- Constant Field Values
-
LOCKED
static final long LOCKED
Used to reset the locked field- See Also:
- Constant Field Values
-
INVITEABLE
static final long INVITEABLE
Used to reset the invitable field- See Also:
- Constant Field Values
-
-
Method Detail
-
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:
resetin interfaceManager<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:
resetin interfaceManager<T extends GuildChannel>- Parameters:
fields- Integer values containing the flags to reset.- Returns:
- ChannelManager for chaining convenience
-
getChannel
@Nonnull T getChannel()
TheGuildChannelthat will be modified by this Manager instance- Returns:
- The
GuildChannel
-
getGuild
@Nonnull default Guild getGuild()
TheGuildthis Manager'sGuildChannelis in.
This is logically the same as callinggetChannel().getGuild()- Returns:
- The parent
Guild
-
setName
@Nonnull @CheckReturnValue M setName(@Nonnull String name)
Sets the name of the selectedGuildChannel.A channel name must not be
nullnor empty or more than 100 characters long!
TextChannel names may only be populated with alphanumeric (with underscore and dash).Example:
mod-onlyorgeneric_name
Characters will automatically be lowercased by Discord for text channels!- Parameters:
name- The new name for the selectedGuildChannel- Returns:
- ChannelManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided name isnullor not between 1-100 characters long
-
-