Package discord4j.core.spec.legacy
Class LegacyRoleEditSpec
- java.lang.Object
-
- discord4j.core.spec.legacy.LegacyRoleEditSpec
-
- All Implemented Interfaces:
LegacyAuditSpec<discord4j.discordjson.json.RoleModifyRequest>
,LegacySpec<discord4j.discordjson.json.RoleModifyRequest>
public class LegacyRoleEditSpec extends Object implements LegacyAuditSpec<discord4j.discordjson.json.RoleModifyRequest>
LegacySpec used to modify a guildRole
.- See Also:
- Modify Guild Role
-
-
Constructor Summary
Constructors Constructor Description LegacyRoleEditSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description discord4j.discordjson.json.RoleModifyRequest
asRequest()
String
getReason()
Returns the current audit log reason set on the spec.LegacyRoleEditSpec
setColor(Color color)
Sets the new color of theRole
.LegacyRoleEditSpec
setHoist(boolean hoist)
Sets whether the modifiedRole
should be displayed separately in the sidebar.LegacyRoleEditSpec
setMentionable(boolean mentionable)
Sets whether the modifiedRole
should be mentionable.LegacyRoleEditSpec
setName(String name)
Sets the new name of theRole
.LegacyRoleEditSpec
setPermissions(PermissionSet permissions)
Sets the new permissions for theRole
.LegacyRoleEditSpec
setReason(String reason)
Sets the reason to show in the audit logs when the spec is built.
-
-
-
Method Detail
-
setName
public LegacyRoleEditSpec setName(String name)
Sets the new name of theRole
.- Parameters:
name
- The role name.- Returns:
- This spec.
-
setPermissions
public LegacyRoleEditSpec setPermissions(PermissionSet permissions)
Sets the new permissions for theRole
.- Parameters:
permissions
- The role permissions.- Returns:
- This spec.
-
setColor
public LegacyRoleEditSpec setColor(Color color)
Sets the new color of theRole
.- Parameters:
color
- The role color.- Returns:
- This spec.
-
setHoist
public LegacyRoleEditSpec setHoist(boolean hoist)
Sets whether the modifiedRole
should be displayed separately in the sidebar.- Parameters:
hoist
- The role hoisted property.- Returns:
- This spec.
-
setMentionable
public LegacyRoleEditSpec setMentionable(boolean mentionable)
Sets whether the modifiedRole
should be mentionable.- Parameters:
mentionable
- The role mentionable property.- Returns:
- This spec.
-
setReason
public LegacyRoleEditSpec 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.RoleModifyRequest>
- 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.RoleModifyRequest>
- Returns:
- The current audit log reason.
-
asRequest
public discord4j.discordjson.json.RoleModifyRequest asRequest()
- Specified by:
asRequest
in interfaceLegacySpec<discord4j.discordjson.json.RoleModifyRequest>
-
-