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 guildTextChannelsettings.- 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.ChannelModifyRequestasRequest()StringgetReason()Returns the current audit log reason set on the spec.LegacyTextChannelEditSpecsetName(String name)Sets the name of the modifiedTextChannel.LegacyTextChannelEditSpecsetNsfw(boolean nsfw)Sets whether the modifiedTextChannelshould be NSFW (not safe for work).LegacyTextChannelEditSpecsetParentId(Snowflake parentId)Sets the identifier of the parent category of the modifiedTextChannel.LegacyTextChannelEditSpecsetPermissionOverwrites(Set<? extends PermissionOverwrite> permissionOverwrites)Sets the modifiedTextChannelpermission overwrites.LegacyTextChannelEditSpecsetPosition(int position)Sets the position of the modifiedTextChannel.LegacyTextChannelEditSpecsetRateLimitPerUser(int rateLimitPerUser)Sets the amount of seconds a user has to wait before sending another message to the modifiedTextChannel, from 0 to 21600 seconds.LegacyTextChannelEditSpecsetReason(String reason)Sets the reason to show in the audit logs when the spec is built.LegacyTextChannelEditSpecsetTopic(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 modifiedTextChannelshould 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 modifiedTextChannelpermission overwrites.- Parameters:
permissionOverwrites- The set ofPermissionOverwriteobjects.- 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_MESSAGESorPermission.MANAGE_CHANNELSpermissions.- Parameters:
rateLimitPerUser- The channel user rate limit, in seconds.- Returns:
- This spec.
-
setReason
public LegacyTextChannelEditSpec 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.ChannelModifyRequest>- 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.ChannelModifyRequest>- Returns:
- The current audit log reason.
-
asRequest
public discord4j.discordjson.json.ChannelModifyRequest asRequest()
- Specified by:
asRequestin interfaceLegacySpec<discord4j.discordjson.json.ChannelModifyRequest>
-
-