Package discord4j.core.spec
Class VoiceChannelCreateSpec
- java.lang.Object
-
- discord4j.core.spec.VoiceChannelCreateSpec
-
- All Implemented Interfaces:
AuditSpec<discord4j.discordjson.json.ChannelCreateRequest>
,Spec<discord4j.discordjson.json.ChannelCreateRequest>
public class VoiceChannelCreateSpec extends Object implements AuditSpec<discord4j.discordjson.json.ChannelCreateRequest>
A spec used to configure and create aVoiceChannel
.
-
-
Constructor Summary
Constructors Constructor Description VoiceChannelCreateSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description discord4j.discordjson.json.ChannelCreateRequest
asRequest()
String
getReason()
Returns the current audit log reason set on the spec.VoiceChannelCreateSpec
setBitrate(int bitrate)
Sets the bitrate for the createdVoiceChannel
.VoiceChannelCreateSpec
setName(String name)
Sets the name for the createdVoiceChannel
.VoiceChannelCreateSpec
setParentId(Snowflake parentId)
Sets the parent ID for the createdVoiceChannel
.VoiceChannelCreateSpec
setPermissionOverwrites(Set<? extends PermissionOverwrite> permissionOverwrites)
Sets the permission overwrites for the createdVoiceChannel
.VoiceChannelCreateSpec
setPosition(int position)
Sets the position for the createdVoiceChannel
.VoiceChannelCreateSpec
setReason(String reason)
Sets the reason to show in the audit logs when the spec is built.VoiceChannelCreateSpec
setUserLimit(int userLimit)
Sets the user limit for the createdVoiceChannel
.
-
-
-
Method Detail
-
setName
public VoiceChannelCreateSpec setName(String name)
Sets the name for the createdVoiceChannel
.- Parameters:
name
- The name of the voice channel.- Returns:
- This spec.
-
setBitrate
public VoiceChannelCreateSpec setBitrate(int bitrate)
Sets the bitrate for the createdVoiceChannel
.- Parameters:
bitrate
- The maximum amount of bits to send per second in the voice channel, related to the quality of audio. A valid bitrate is a number from 8 to 96.- Returns:
- This spec.
-
setUserLimit
public VoiceChannelCreateSpec setUserLimit(int userLimit)
Sets the user limit for the createdVoiceChannel
.Users with
Permission.MOVE_MEMBERS
ignore this limit and can also move other users into the channel past the limit.- Parameters:
userLimit
- The maximum number of users that can join the voice channel at once.- Returns:
- This spec.
-
setPosition
public VoiceChannelCreateSpec setPosition(int position)
Sets the position for the createdVoiceChannel
.- Parameters:
position
- The raw position for the channel.- Returns:
- This spec.
-
setPermissionOverwrites
public VoiceChannelCreateSpec setPermissionOverwrites(Set<? extends PermissionOverwrite> permissionOverwrites)
Sets the permission overwrites for the createdVoiceChannel
.- Parameters:
permissionOverwrites
- TheSet<PermissionOverwrite>
which contains overwrites for the channel.- Returns:
- This spec.
-
setParentId
public VoiceChannelCreateSpec setParentId(@Nullable Snowflake parentId)
Sets the parent ID for the createdVoiceChannel
.The parent ID is equivalent to a
Category
ID.- Parameters:
parentId
- TheSnowflake
of the parentCategory
.- Returns:
- This spec.
-
setReason
public VoiceChannelCreateSpec setReason(@Nullable String reason)
Description copied from interface:AuditSpec
Sets the reason to show in the audit logs when the spec is built.
-
getReason
@Nullable public String getReason()
Description copied from interface:AuditSpec
Returns the current audit log reason set on the spec.
-
-