public class ChannelManager
extends java.lang.Object
ChannelManagerUpdatable
instance.
This decoration allows to modify a single field by automatically building an update RestAction
Constructor and Description |
---|
ChannelManager(Channel channel)
Creates a new ChannelManager instance
|
Modifier and Type | Method and Description |
---|---|
Channel |
getChannel()
The
Channel that will
be modified by this Manager instance |
Guild |
getGuild()
|
JDA |
getJDA()
The
JDA instance of this Manager |
AuditableRestAction<java.lang.Void> |
setBitrate(int bitrate)
Sets the bitrate of the selected
VoiceChannel . |
AuditableRestAction<java.lang.Void> |
setName(java.lang.String name)
Sets the name of the selected
Channel . |
AuditableRestAction<java.lang.Void> |
setNSFW(boolean nsfw)
Sets the nsfw flag of the selected
TextChannel . |
AuditableRestAction<java.lang.Void> |
setTopic(java.lang.String topic)
Sets the topic of the selected
TextChannel . |
AuditableRestAction<java.lang.Void> |
setUserLimit(int userLimit)
Sets the user-limit of the selected
VoiceChannel . |
public ChannelManager(Channel channel)
channel
- Channel
that should be modified
Voice
- or TextChannel
public Channel getChannel()
Channel
that will
be modified by this Manager instanceChannel
ChannelManagerUpdatable.getChannel()
public Guild getGuild()
Guild
this Manager's
Channel
is in.
getChannel().getGuild()
Guild
ChannelManagerUpdatable.getGuild()
@CheckReturnValue public AuditableRestAction<java.lang.Void> 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!
name
- The new name for the selected Channel
AuditableRestAction
#update()
InsufficientPermissionException
- If the currently logged in account does not have the Permission MANAGE_CHANNEL
java.lang.IllegalArgumentException
- If the provided name is null
or not between 2-100 characters longChannelManagerUpdatable.getNameField()
,
ChannelManagerUpdatable.update()
@CheckReturnValue public AuditableRestAction<java.lang.Void> 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 resetAuditableRestAction
#update()
InsufficientPermissionException
- If the currently logged in account does not have the Permission MANAGE_CHANNEL
java.lang.UnsupportedOperationException
- If the selected Channel
's type is not TEXT
java.lang.IllegalArgumentException
- If the provided topic is greater than 1024
in lengthChannelManagerUpdatable.getTopicField()
,
ChannelManagerUpdatable.update()
public AuditableRestAction<java.lang.Void> setNSFW(boolean nsfw)
TextChannel
.nsfw
- The new nsfw flag for the selected TextChannel
,AuditableRestAction
#update()
InsufficientPermissionException
- If the currently logged in account does not have the Permission MANAGE_CHANNEL
java.lang.UnsupportedOperationException
- If the selected Channel
's type is not TEXT
ChannelManagerUpdatable.getNSFWField()
,
ChannelManagerUpdatable.update()
@CheckReturnValue public AuditableRestAction<java.lang.Void> 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
AuditableRestAction
#update()
InsufficientPermissionException
- If the currently logged in account does not have the Permission MANAGE_CHANNEL
java.lang.UnsupportedOperationException
- If the selected Channel
's type is not TEXT
java.lang.IllegalArgumentException
- If the provided user-limit is negative or greater than 99
ChannelManagerUpdatable.getUserLimitField()
,
ChannelManagerUpdatable.update()
@CheckReturnValue public AuditableRestAction<java.lang.Void> setBitrate(int bitrate)
VoiceChannel
.
64000
A channel user-limit must not be less than 8000
nor greater than 96000
(for non-vip Guilds)!
This is only available to VoiceChannels
bitrate
- The new bitrate for the selected VoiceChannel
AuditableRestAction
#update()
InsufficientPermissionException
- If the currently logged in account does not have the Permission MANAGE_CHANNEL
java.lang.UnsupportedOperationException
- If the selected Channel
's type is not VOICE
java.lang.IllegalArgumentException
- If the provided bitrate is not between 8000-96000ChannelManagerUpdatable.getBitrateField()
,
ChannelManagerUpdatable.update()