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 Summary
Modifier and TypeFieldDescriptionstatic final long
Used to reset the archived fieldstatic final long
Used to reset the auto-archive-duration fieldstatic final long
Used to reset the bitrate fieldstatic final long
Used to reset the invitable fieldstatic final long
Used to reset the locked fieldstatic final long
Used to reset the name fieldstatic final long
Used to reset the nsfw fieldstatic final long
Used to reset the parent fieldstatic final long
Used to reset the permission fieldstatic final long
Used to reset the position fieldstatic final long
Used to reset the region fieldstatic final long
Used to reset the rate-limit per user fieldstatic final long
Used to reset the topic fieldstatic final long
Used to reset the channel type fieldstatic final long
Used to reset the userlimit field -
Method Summary
Modifier and TypeMethodDescriptionTheGuildChannel
that will be modified by this Manager instancedefault Guild
getGuild()
TheGuild
this Manager'sGuildChannel
is in.reset
(long fields) Resets the fields specified by the provided bit-flag pattern.reset
(long... fields) Resets the fields specified by the provided bit-flag patterns.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 Details
-
NAME
static final long NAMEUsed to reset the name field- See Also:
-
PARENT
static final long PARENTUsed to reset the parent field- See Also:
-
TOPIC
static final long TOPICUsed to reset the topic field- See Also:
-
POSITION
static final long POSITIONUsed to reset the position field- See Also:
-
NSFW
static final long NSFWUsed to reset the nsfw field- See Also:
-
USERLIMIT
static final long USERLIMITUsed to reset the userlimit field- See Also:
-
BITRATE
static final long BITRATEUsed to reset the bitrate field- See Also:
-
PERMISSION
static final long PERMISSIONUsed to reset the permission field- See Also:
-
SLOWMODE
static final long SLOWMODEUsed to reset the rate-limit per user field- See Also:
-
TYPE
static final long TYPEUsed to reset the channel type field- See Also:
-
REGION
static final long REGIONUsed to reset the region field- See Also:
-
AUTO_ARCHIVE_DURATION
static final long AUTO_ARCHIVE_DURATIONUsed to reset the auto-archive-duration field- See Also:
-
ARCHIVED
static final long ARCHIVEDUsed to reset the archived field- See Also:
-
LOCKED
static final long LOCKEDUsed to reset the locked field- See Also:
-
INVITEABLE
static final long INVITEABLEUsed to reset the invitable field- See Also:
-
-
Method Details
-
reset
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 interfaceManager<T extends GuildChannel>
- Parameters:
fields
- Integer value containing the flags to reset.- Returns:
- ChannelManager for chaining convenience
-
reset
Resets the fields specified by the provided bit-flag patterns.
Example:manager.reset(ChannelManager.NAME, ChannelManager.PARENT);
Flag Constants:
- Specified by:
reset
in interfaceManager<T extends GuildChannel>
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- ChannelManager for chaining convenience
-
getChannel
TheGuildChannel
that will be modified by this Manager instance- Returns:
- The
GuildChannel
-
getGuild
TheGuild
this Manager'sGuildChannel
is in.
This is logically the same as callinggetChannel().getGuild()
- Returns:
- The parent
Guild
-
setName
Sets the name of the selectedGuildChannel
.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
orgeneric_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 isnull
or not between 1-100 characters long
-