public class ChannelManager
extends net.dv8tion.jda.core.managers.impl.ManagerBase
Guild Channel
.
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();
Channel.getManager()
AuditableRestAction.EmptyRestAction<T>
Modifier and Type | Field | Description |
---|---|---|
static long |
BITRATE |
Used to reset the bitrate field
|
static long |
NAME |
Used to reset the name field
|
static long |
NSFW |
Used to reset the nsfw field
|
static long |
PARENT |
Used to reset the parent field
|
static long |
POSITION |
Used to reset the position field
|
static long |
TOPIC |
Used to reset the topic field
|
static long |
USERLIMIT |
Used to reset the userlimit field
|
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor | Description |
---|---|
ChannelManager(Channel channel) |
Creates a new ChannelManager instance
|
Modifier and Type | Method | Description |
---|---|---|
Channel |
getChannel() |
The
Channel that will
be modified by this Manager instance |
Guild |
getGuild() |
|
ChannelType |
getType() |
|
ChannelManager |
reset() |
Resets all fields for this manager.
|
ChannelManager |
reset(long fields) |
Resets the fields specified by the provided bit-flag pattern.
|
ChannelManager |
reset(long... fields) |
Resets the fields specified by the provided bit-flag patterns.
|
ChannelManager |
setBitrate(int bitrate) |
Sets the bitrate of the selected
VoiceChannel . |
ChannelManager |
setName(java.lang.String name) |
Sets the name of the selected
Channel . |
ChannelManager |
setNSFW(boolean nsfw) |
Sets the nsfw flag of the selected
TextChannel . |
ChannelManager |
setParent(Category category) |
Sets the
Parent Category
of the selected Channel . |
ChannelManager |
setPosition(int position) |
Sets the position of the selected
Channel . |
ChannelManager |
setTopic(java.lang.String topic) |
Sets the topic of the selected
TextChannel . |
ChannelManager |
setUserLimit(int userLimit) |
Sets the user-limit of the selected
VoiceChannel . |
reason, setCheck
complete, isPermissionChecksEnabled, queue, setPermissionChecksEnabled
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
complete, completeAfter, getJDA, isPassContext, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
public static final long NAME
public static final long PARENT
public static final long TOPIC
public static final long POSITION
public static final long NSFW
public static final long USERLIMIT
public static final long BITRATE
public ChannelManager(Channel channel)
channel
- Channel
that should be modified
Voice
- or TextChannel
public ChannelType getType()
public Channel getChannel()
Channel
that will
be modified by this Manager instanceChannel
public Guild getGuild()
Guild
this Manager's
Channel
is in.
getChannel().getGuild()
Guild
@CheckReturnValue public ChannelManager reset(long fields)
manager.reset(ChannelManager.NAME | ChannelManager.PARENT);
Flag Constants:
reset
in class net.dv8tion.jda.core.managers.impl.ManagerBase
fields
- Integer value containing the flags to reset.@CheckReturnValue public ChannelManager reset(long... fields)
manager.reset(ChannelManager.NAME, ChannelManager.PARENT);
Flag Constants:
reset
in class net.dv8tion.jda.core.managers.impl.ManagerBase
fields
- Integer values containing the flags to reset.@CheckReturnValue public ChannelManager reset()
reset
in class net.dv8tion.jda.core.managers.impl.ManagerBase
@CheckReturnValue public ChannelManager setName(java.lang.String name)
Channel
.
A channel name must not be null
nor less than 2 characters 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!
name
- The new name for the selected Channel
java.lang.IllegalArgumentException
- If the provided name is null
or not between 2-100 characters long@CheckReturnValue public ChannelManager setParent(Category category)
Parent Category
of the selected Channel
.category
- The new parent for the selected Channel
java.lang.IllegalStateException
- If the target is a category itselfjava.lang.IllegalArgumentException
- If the provided category is not from the same Guild@CheckReturnValue public ChannelManager setPosition(int position)
Channel
.
To modify multiple channels you should use
Guild.
instead! This is not the same as looping through channels and using this to update positions!getController()
.modifyTextChannelPositions()
position
- The new position for the selected Channel
@CheckReturnValue public ChannelManager setTopic(java.lang.String topic)
TextChannel
.
A channel topic must not be more than 1024
characters long!
This is only available to TextChannels
topic
- The new topic for the selected TextChannel
,
null
or empty String to resetjava.lang.UnsupportedOperationException
- If the selected Channel
's type is not TEXT
java.lang.IllegalArgumentException
- If the provided topic is greater than 1024
in length@CheckReturnValue public ChannelManager setNSFW(boolean nsfw)
TextChannel
.nsfw
- The new nsfw flag for the selected TextChannel
,InsufficientPermissionException
- If the currently logged in account does not have the Permission MANAGE_CHANNEL
java.lang.IllegalStateException
- If the selected Channel
's type is not TEXT
@CheckReturnValue public ChannelManager setUserLimit(int userLimit)
VoiceChannel
.
0
to reset the user-limit of the VoiceChannel
A channel user-limit must not be negative nor greater than 99
!
This is only available to VoiceChannels
userLimit
- The new user-limit for the selected VoiceChannel
java.lang.IllegalStateException
- If the selected Channel
's type is not VOICE
java.lang.IllegalArgumentException
- If the provided user-limit is negative or greater than 99
@CheckReturnValue public ChannelManager setBitrate(int bitrate)
VoiceChannel
.
64000
A channel bitrate must not be less than 8000
nor greater than 96000
(for non-vip Guilds)!
VIP Guilds
allow a bitrate for up to 128000
.
This is only available to VoiceChannels
bitrate
- The new bitrate for the selected VoiceChannel
java.lang.IllegalStateException
- If the selected Channel
's type is not VOICE
java.lang.IllegalArgumentException
- If the provided bitrate is not between 8000-96000 (or 128000 for VIP Guilds)Guild.getFeatures()