Package discord4j.core.spec.legacy
Class LegacyTextChannelCreateSpec
- java.lang.Object
-
- discord4j.core.spec.legacy.LegacyTextChannelCreateSpec
-
- All Implemented Interfaces:
LegacyAuditSpec<discord4j.discordjson.json.ChannelCreateRequest>,LegacySpec<discord4j.discordjson.json.ChannelCreateRequest>
public class LegacyTextChannelCreateSpec extends Object implements LegacyAuditSpec<discord4j.discordjson.json.ChannelCreateRequest>
LegacySpec used to create guildTextChannelentities.- See Also:
- Create Guild Channel
-
-
Constructor Summary
Constructors Constructor Description LegacyTextChannelCreateSpec()
-
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.LegacyTextChannelCreateSpecsetName(String name)Sets the name of the createdTextChannel.LegacyTextChannelCreateSpecsetNsfw(boolean nsfw)Sets whether the createdTextChannelis NSFW (not safe for work).LegacyTextChannelCreateSpecsetParentId(Snowflake parentId)Sets the identifier of the parent category of the createdTextChannel.LegacyTextChannelCreateSpecsetPermissionOverwrites(Set<? extends PermissionOverwrite> permissionOverwrites)Sets the createdTextChannelpermission overwrites.LegacyTextChannelCreateSpecsetPosition(int position)Sets the sorting position of the createdTextChannel.LegacyTextChannelCreateSpecsetRateLimitPerUser(int rateLimitPerUser)Sets the amount of seconds a user has to wait before sending another message to the createdTextChannel, from 0 to 120.LegacyTextChannelCreateSpecsetReason(String reason)Sets the reason to show in the audit logs when the spec is built.LegacyTextChannelCreateSpecsetTopic(String topic)Sets the createdTextChanneltopic.
-
-
-
Method Detail
-
setName
public LegacyTextChannelCreateSpec setName(String name)
Sets the name of the createdTextChannel.- Parameters:
name- The channel name.- Returns:
- This spec.
-
setTopic
public LegacyTextChannelCreateSpec setTopic(@Nullable String topic)
Sets the createdTextChanneltopic.- Parameters:
topic- The channel topic.- Returns:
- This spec.
-
setRateLimitPerUser
public LegacyTextChannelCreateSpec setRateLimitPerUser(int rateLimitPerUser)
Sets the amount of seconds a user has to wait before sending another message to the createdTextChannel, from 0 to 120. Does not affect bots or users withPermission.MANAGE_MESSAGESorPermission.MANAGE_CHANNELSpermissions.- Parameters:
rateLimitPerUser- The channel user rate limit, in seconds.- Returns:
- This spec.
-
setPosition
public LegacyTextChannelCreateSpec setPosition(int position)
Sets the sorting position of the createdTextChannel.- Parameters:
position- The channel position.- Returns:
- This spec.
-
setPermissionOverwrites
public LegacyTextChannelCreateSpec setPermissionOverwrites(Set<? extends PermissionOverwrite> permissionOverwrites)
Sets the createdTextChannelpermission overwrites.- Parameters:
permissionOverwrites- The set ofPermissionOverwriteobjects.- Returns:
- This spec.
-
setParentId
public LegacyTextChannelCreateSpec setParentId(@Nullable Snowflake parentId)
Sets the identifier of the parent category of the createdTextChannel.- Parameters:
parentId- The parent category identifier.- Returns:
- This spec.
-
setNsfw
public LegacyTextChannelCreateSpec setNsfw(boolean nsfw)
Sets whether the createdTextChannelis NSFW (not safe for work).- Parameters:
nsfw- The channel nsfw property.- Returns:
- This spec.
-
setReason
public LegacyTextChannelCreateSpec 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>
-
-