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 long
ARCHIVED
Used to reset the archived fieldstatic long
AUTO_ARCHIVE_DURATION
Used to reset the auto-archive-duration fieldstatic long
BITRATE
Used to reset the bitrate fieldstatic long
INVITEABLE
Used to reset the invitable fieldstatic long
LOCKED
Used to reset the locked fieldstatic long
NAME
Used to reset the name fieldstatic long
NSFW
Used to reset the nsfw fieldstatic long
PARENT
Used to reset the parent fieldstatic long
PERMISSION
Used to reset the permission fieldstatic long
POSITION
Used to reset the position fieldstatic long
REGION
Used to reset the region fieldstatic long
SLOWMODE
Used to reset the rate-limit per user fieldstatic long
TOPIC
Used to reset the topic fieldstatic long
TYPE
Used to reset the channel type fieldstatic long
USERLIMIT
Used to reset the userlimit field
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description T
getChannel()
TheGuildChannel
that will be modified by this Manager instancedefault Guild
getGuild()
TheGuild
this Manager'sGuildChannel
is in.M
reset(long fields)
Resets the fields specified by the provided bit-flag pattern.M
reset(long... fields)
Resets the fields specified by the provided bit-flag patterns.M
setName(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:
reset
in 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:
reset
in interfaceManager<T extends GuildChannel>
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- ChannelManager for chaining convenience
-
getChannel
@Nonnull T getChannel()
TheGuildChannel
that will be modified by this Manager instance- Returns:
- The
GuildChannel
-
getGuild
@Nonnull default Guild getGuild()
TheGuild
this Manager'sGuildChannel
is 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
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
-
-