Package discord4j.core.spec.legacy
Class LegacyTextChannelEditSpec
- java.lang.Object
-
- discord4j.core.spec.legacy.LegacyTextChannelEditSpec
-
- All Implemented Interfaces:
LegacyAuditSpec<discord4j.discordjson.json.ChannelModifyRequest>
,LegacySpec<discord4j.discordjson.json.ChannelModifyRequest>
public class LegacyTextChannelEditSpec extends Object implements LegacyAuditSpec<discord4j.discordjson.json.ChannelModifyRequest>
LegacySpec used to modify a guildTextChannel
settings.- See Also:
- Modify Channel
-
-
Constructor Summary
Constructors Constructor Description LegacyTextChannelEditSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description discord4j.discordjson.json.ChannelModifyRequest
asRequest()
String
getReason()
Returns the current audit log reason set on the spec.LegacyTextChannelEditSpec
setName(String name)
Sets the name of the modifiedTextChannel
.LegacyTextChannelEditSpec
setNsfw(boolean nsfw)
Sets whether the modifiedTextChannel
should be NSFW (not safe for work).LegacyTextChannelEditSpec
setParentId(Snowflake parentId)
Sets the identifier of the parent category of the modifiedTextChannel
.LegacyTextChannelEditSpec
setPermissionOverwrites(Set<? extends PermissionOverwrite> permissionOverwrites)
Sets the modifiedTextChannel
permission overwrites.LegacyTextChannelEditSpec
setPosition(int position)
Sets the position of the modifiedTextChannel
.LegacyTextChannelEditSpec
setRateLimitPerUser(int rateLimitPerUser)
Sets the amount of seconds a user has to wait before sending another message to the modifiedTextChannel
, from 0 to 21600 seconds.LegacyTextChannelEditSpec
setReason(String reason)
Sets the reason to show in the audit logs when the spec is built.LegacyTextChannelEditSpec
setTopic(String topic)
Sets the topic of the modifiedTextChannel
.
-
-
-
Method Detail
-
setName
public LegacyTextChannelEditSpec setName(String name)
Sets the name of the modifiedTextChannel
.- Parameters:
name
- The channel name.- Returns:
- This spec.
-
setPosition
public LegacyTextChannelEditSpec setPosition(int position)
Sets the position of the modifiedTextChannel
.- Parameters:
position
- The channel position.- Returns:
- This spec.
-
setTopic
public LegacyTextChannelEditSpec setTopic(String topic)
Sets the topic of the modifiedTextChannel
.- Parameters:
topic
- The channel topic.- Returns:
- This spec.
-
setNsfw
public LegacyTextChannelEditSpec setNsfw(boolean nsfw)
Sets whether the modifiedTextChannel
should be NSFW (not safe for work).- Parameters:
nsfw
- The channel nsfw property.- Returns:
- This spec.
-
setPermissionOverwrites
public LegacyTextChannelEditSpec setPermissionOverwrites(Set<? extends PermissionOverwrite> permissionOverwrites)
Sets the modifiedTextChannel
permission overwrites.- Parameters:
permissionOverwrites
- The set ofPermissionOverwrite
objects.- Returns:
- This spec.
-
setParentId
public LegacyTextChannelEditSpec setParentId(@Nullable Snowflake parentId)
Sets the identifier of the parent category of the modifiedTextChannel
.- Parameters:
parentId
- The parent category identifier.- Returns:
- This spec.
-
setRateLimitPerUser
public LegacyTextChannelEditSpec setRateLimitPerUser(int rateLimitPerUser)
Sets the amount of seconds a user has to wait before sending another message to the modifiedTextChannel
, from 0 to 21600 seconds. 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.
-
setReason
public LegacyTextChannelEditSpec setReason(@Nullable String reason)
Description copied from interface:LegacyAuditSpec
Sets the reason to show in the audit logs when the spec is built.- Specified by:
setReason
in interfaceLegacyAuditSpec<discord4j.discordjson.json.ChannelModifyRequest>
- Parameters:
reason
- The audit log reason.- Returns:
- This spec.
-
getReason
@Nullable public String getReason()
Description copied from interface:LegacyAuditSpec
Returns the current audit log reason set on the spec.- Specified by:
getReason
in interfaceLegacyAuditSpec<discord4j.discordjson.json.ChannelModifyRequest>
- Returns:
- The current audit log reason.
-
asRequest
public discord4j.discordjson.json.ChannelModifyRequest asRequest()
- Specified by:
asRequest
in interfaceLegacySpec<discord4j.discordjson.json.ChannelModifyRequest>
-
-