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 TextChannelpublic Channel getChannel()
Channel that will
be modified by this Manager instanceChannelChannelManagerUpdatable.getChannel()public Guild getGuild()
Guild this Manager's
Channel is in.
getChannel().getGuild()GuildChannelManagerUpdatable.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 ChannelAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_CHANNELjava.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_CHANNELjava.lang.UnsupportedOperationException - If the selected Channel's type is not TEXTjava.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_CHANNELjava.lang.UnsupportedOperationException - If the selected Channel's type is not TEXTChannelManagerUpdatable.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 VoiceChannelAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_CHANNELjava.lang.UnsupportedOperationException - If the selected Channel's type is not TEXTjava.lang.IllegalArgumentException - If the provided user-limit is negative or greater than 99ChannelManagerUpdatable.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 VoiceChannelAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_CHANNELjava.lang.UnsupportedOperationException - If the selected Channel's type is not VOICEjava.lang.IllegalArgumentException - If the provided bitrate is not between 8000-96000ChannelManagerUpdatable.getBitrateField(),
ChannelManagerUpdatable.update()