Package discord4j.core.spec.legacy
Class LegacyVoiceChannelCreateSpec
- java.lang.Object
-
- discord4j.core.spec.legacy.LegacyVoiceChannelCreateSpec
-
- All Implemented Interfaces:
LegacyAuditSpec<discord4j.discordjson.json.ChannelCreateRequest>,LegacySpec<discord4j.discordjson.json.ChannelCreateRequest>
public class LegacyVoiceChannelCreateSpec extends Object implements LegacyAuditSpec<discord4j.discordjson.json.ChannelCreateRequest>
A spec used to configure and create aVoiceChannel.
-
-
Constructor Summary
Constructors Constructor Description LegacyVoiceChannelCreateSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description discord4j.discordjson.json.ChannelCreateRequestasRequest()StringgetReason()Returns the current audit log reason set on the spec.LegacyVoiceChannelCreateSpecsetBitrate(int bitrate)Sets the bitrate for the createdVoiceChannel.LegacyVoiceChannelCreateSpecsetName(String name)Sets the name for the createdVoiceChannel.LegacyVoiceChannelCreateSpecsetParentId(Snowflake parentId)Sets the parent ID for the createdVoiceChannel.LegacyVoiceChannelCreateSpecsetPermissionOverwrites(Set<? extends PermissionOverwrite> permissionOverwrites)Sets the permission overwrites for the createdVoiceChannel.LegacyVoiceChannelCreateSpecsetPosition(int position)Sets the position for the createdVoiceChannel.LegacyVoiceChannelCreateSpecsetReason(String reason)Sets the reason to show in the audit logs when the spec is built.LegacyVoiceChannelCreateSpecsetUserLimit(int userLimit)Sets the user limit for the createdVoiceChannel.
-
-
-
Method Detail
-
setName
public LegacyVoiceChannelCreateSpec setName(String name)
Sets the name for the createdVoiceChannel.- Parameters:
name- The name of the voice channel.- Returns:
- This spec.
-
setBitrate
public LegacyVoiceChannelCreateSpec 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 LegacyVoiceChannelCreateSpec setUserLimit(int userLimit)
Sets the user limit for the createdVoiceChannel.Users with
Permission.MOVE_MEMBERSignore 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 LegacyVoiceChannelCreateSpec setPosition(int position)
Sets the position for the createdVoiceChannel.- Parameters:
position- The raw position for the channel.- Returns:
- This spec.
-
setPermissionOverwrites
public LegacyVoiceChannelCreateSpec 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 LegacyVoiceChannelCreateSpec setParentId(@Nullable Snowflake parentId)
Sets the parent ID for the createdVoiceChannel.The parent ID is equivalent to a
CategoryID.- Parameters:
parentId- TheSnowflakeof the parentCategory.- Returns:
- This spec.
-
setReason
public LegacyVoiceChannelCreateSpec setReason(@Nullable String reason)
Description copied from interface:LegacyAuditSpecSets the reason to show in the audit logs when the spec is built.- Specified by:
setReasonin interfaceLegacyAuditSpec<discord4j.discordjson.json.ChannelCreateRequest>- Parameters:
reason- The audit log reason.- Returns:
- This spec.
-
getReason
@Nullable public String getReason()
Description copied from interface:LegacyAuditSpecReturns the current audit log reason set on the spec.- Specified by:
getReasonin interfaceLegacyAuditSpec<discord4j.discordjson.json.ChannelCreateRequest>- Returns:
- The current audit log reason.
-
asRequest
public discord4j.discordjson.json.ChannelCreateRequest asRequest()
- Specified by:
asRequestin interfaceLegacySpec<discord4j.discordjson.json.ChannelCreateRequest>
-
-