Package discord4j.core.spec
Class TextChannelCreateSpec
- java.lang.Object
-
- discord4j.core.spec.TextChannelCreateSpec
-
- All Implemented Interfaces:
AuditSpec<discord4j.discordjson.json.ChannelCreateRequest>
,Spec<discord4j.discordjson.json.ChannelCreateRequest>
public class TextChannelCreateSpec extends Object implements AuditSpec<discord4j.discordjson.json.ChannelCreateRequest>
Spec used to create guildTextChannel
entities.- See Also:
- Create Guild Channel
-
-
Constructor Summary
Constructors Constructor Description TextChannelCreateSpec()
-
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.TextChannelCreateSpec
setName(String name)
Sets the name of the createdTextChannel
.TextChannelCreateSpec
setNsfw(boolean nsfw)
Sets whether the createdTextChannel
is NSFW (not safe for work).TextChannelCreateSpec
setParentId(Snowflake parentId)
Sets the identifier of the parent category of the createdTextChannel
.TextChannelCreateSpec
setPermissionOverwrites(Set<? extends PermissionOverwrite> permissionOverwrites)
Sets the createdTextChannel
permission overwrites.TextChannelCreateSpec
setPosition(int position)
Sets the sorting position of the createdTextChannel
.TextChannelCreateSpec
setRateLimitPerUser(int rateLimitPerUser)
Sets the amount of seconds a user has to wait before sending another message to the createdTextChannel
, from 0 to 120.TextChannelCreateSpec
setReason(String reason)
Sets the reason to show in the audit logs when the spec is built.TextChannelCreateSpec
setTopic(String topic)
Sets the createdTextChannel
topic.
-
-
-
Method Detail
-
setName
public TextChannelCreateSpec setName(String name)
Sets the name of the createdTextChannel
.- Parameters:
name
- The channel name.- Returns:
- This spec.
-
setTopic
public TextChannelCreateSpec setTopic(@Nullable String topic)
Sets the createdTextChannel
topic.- Parameters:
topic
- The channel topic.- Returns:
- This spec.
-
setRateLimitPerUser
public TextChannelCreateSpec 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_MESSAGES
orPermission.MANAGE_CHANNELS
permissions.- Parameters:
rateLimitPerUser
- The channel user rate limit, in seconds.- Returns:
- This spec.
-
setPosition
public TextChannelCreateSpec setPosition(int position)
Sets the sorting position of the createdTextChannel
.- Parameters:
position
- The channel position.- Returns:
- This spec.
-
setPermissionOverwrites
public TextChannelCreateSpec setPermissionOverwrites(Set<? extends PermissionOverwrite> permissionOverwrites)
Sets the createdTextChannel
permission overwrites.- Parameters:
permissionOverwrites
- The set ofPermissionOverwrite
objects.- Returns:
- This spec.
-
setParentId
public TextChannelCreateSpec 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 TextChannelCreateSpec setNsfw(boolean nsfw)
Sets whether the createdTextChannel
is NSFW (not safe for work).- Parameters:
nsfw
- The channel nsfw property.- Returns:
- This spec.
-
setReason
public TextChannelCreateSpec 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.
-
-