public class ChannelAction extends AuditableRestAction<Channel>
RestAction
specifically
designed to create a Channel
.
This extension allows setting properties before executing the action.AuditableRestAction.EmptyRestAction<T>, AuditableRestAction.FailedRestAction<T>
Modifier and Type | Field | Description |
---|---|---|
static int |
MEMBER_TYPE |
|
static int |
ROLE_TYPE |
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor | Description |
---|---|
ChannelAction(net.dv8tion.jda.core.requests.Route.CompiledRoute route,
java.lang.String name,
Guild guild,
ChannelType type) |
Creates a new ChannelAction instance
|
Modifier and Type | Method | Description |
---|---|---|
ChannelAction |
addPermissionOverride(Member member,
long allow,
long deny) |
Adds a new Member-
PermissionOverride
for the new Channel. |
ChannelAction |
addPermissionOverride(Member member,
java.util.Collection<Permission> allow,
java.util.Collection<Permission> deny) |
Adds a new Member-
PermissionOverride
for the new Channel. |
ChannelAction |
addPermissionOverride(Role role,
long allow,
long deny) |
Adds a new Role-
PermissionOverride
for the new Channel. |
ChannelAction |
addPermissionOverride(Role role,
java.util.Collection<Permission> allow,
java.util.Collection<Permission> deny) |
Adds a new Role-
PermissionOverride
for the new Channel. |
ChannelAction |
setBitrate(java.lang.Integer bitrate) |
Sets the bitrate for the new VoiceChannel
|
ChannelAction |
setName(java.lang.String name) |
Sets the name for the new Channel
|
ChannelAction |
setNSFW(boolean nsfw) |
Sets the NSFW flag for the new TextChannel
|
ChannelAction |
setParent(Category category) |
Sets the
Category for the new Channel |
ChannelAction |
setTopic(java.lang.String topic) |
Sets the topic for the new TextChannel
|
ChannelAction |
setUserlimit(java.lang.Integer userlimit) |
Sets the userlimit for the new VoiceChannel
|
reason
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
complete, complete, completeAfter, getJDA, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter
public static final int ROLE_TYPE
public static final int MEMBER_TYPE
public ChannelAction(net.dv8tion.jda.core.requests.Route.CompiledRoute route, java.lang.String name, Guild guild, ChannelType type)
@CheckReturnValue public ChannelAction setName(java.lang.String name)
name
- The not-null name for the new Channel (2-100 chars long)java.lang.IllegalArgumentException
- If the provided name is null or not between 2-100 chars long@CheckReturnValue public ChannelAction setParent(Category category)
Category
for the new Channelcategory
- The parent for the new Channeljava.lang.UnsupportedOperationException
- If this ChannelAction is for a Categoryjava.lang.IllegalArgumentException
- If the provided category is null
or not from this Guild@CheckReturnValue public ChannelAction setTopic(java.lang.String topic)
topic
- The topic for the new Channel (max 1024 chars)java.lang.UnsupportedOperationException
- If this ChannelAction is not for a TextChanneljava.lang.IllegalArgumentException
- If the provided topic is longer than 1024 chars@CheckReturnValue public ChannelAction setNSFW(boolean nsfw)
nsfw
- The NSFW flag for the new Channeljava.lang.UnsupportedOperationException
- If this ChannelAction is not for a TextChannel@CheckReturnValue public ChannelAction addPermissionOverride(Role role, java.util.Collection<Permission> allow, java.util.Collection<Permission> deny)
PermissionOverride
for the new Channel.role
- The not-null Role
for the overrideallow
- The granted Permissions
for the override or nulldeny
- The denied Permissions
for the override or nulljava.lang.IllegalArgumentException
- If the specified Role
is null
or not within the same guild.@CheckReturnValue public ChannelAction addPermissionOverride(Member member, java.util.Collection<Permission> allow, java.util.Collection<Permission> deny)
PermissionOverride
for the new Channel.member
- The not-null Member
for the overrideallow
- The granted Permissions
for the override or nulldeny
- The denied Permissions
for the override or nulljava.lang.IllegalArgumentException
- If the specified Member
is null
or not within the same guild.@CheckReturnValue public ChannelAction addPermissionOverride(Role role, long allow, long deny)
PermissionOverride
for the new Channel.role
- The not-null Role
for the overrideallow
- The granted Permissions
for the override
Use Permission.getRawValue()
to retrieve these Permissions.deny
- The denied Permissions
for the override
Use Permission.getRawValue()
to retrieve these Permissions.java.lang.IllegalArgumentException
- Role
is null
or not within the same guild.Permission.getRawValue()
,
Permission.getRaw(java.util.Collection)
,
Permission.getRaw(net.dv8tion.jda.core.Permission...)
@CheckReturnValue public ChannelAction addPermissionOverride(Member member, long allow, long deny)
PermissionOverride
for the new Channel.member
- The not-null Member
for the overrideallow
- The granted Permissions
for the override
Use Permission.getRawValue()
to retrieve these Permissions.deny
- The denied Permissions
for the override
Use Permission.getRawValue()
to retrieve these Permissions.java.lang.IllegalArgumentException
- Member
is null
or not within the same guild.Permission.getRawValue()
,
Permission.getRaw(java.util.Collection)
,
Permission.getRaw(net.dv8tion.jda.core.Permission...)
@CheckReturnValue public ChannelAction setBitrate(java.lang.Integer bitrate)
bitrate
- The bitrate for the new Channel (min 8000) or null to use default (64000)java.lang.UnsupportedOperationException
- If this ChannelAction is not for a VoiceChanneljava.lang.IllegalArgumentException
- If the provided bitrate is less than 8000 or greater than 128000@CheckReturnValue public ChannelAction setUserlimit(java.lang.Integer userlimit)
userlimit
- The userlimit for the new VoiceChannel or null
/0
to use no limit,java.lang.UnsupportedOperationException
- If this ChannelAction is not for a VoiceChanneljava.lang.IllegalArgumentException
- If the provided userlimit is negative or above 99