Package discord4j.core.spec.legacy
Class LegacyRoleCreateSpec
java.lang.Object
discord4j.core.spec.legacy.LegacyRoleCreateSpec
- All Implemented Interfaces:
LegacyAuditSpec<discord4j.discordjson.json.RoleCreateRequest>
,LegacySpec<discord4j.discordjson.json.RoleCreateRequest>
public class LegacyRoleCreateSpec
extends Object
implements LegacyAuditSpec<discord4j.discordjson.json.RoleCreateRequest>
LegacySpec used to create a new guild
Role
entity.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondiscord4j.discordjson.json.RoleCreateRequest
Returns the current audit log reason set on the spec.Sets the color of the createdRole
.setHoist
(boolean hoist) Sets whether the createdRole
should be displayed separately in the sidebar.setMentionable
(boolean mentionable) Sets whether the createdRole
should be mentionable.Sets the name of the createdRole
.setPermissions
(PermissionSet permissions) Sets the enabled/disabled permissions, in the form of aPermissionSet
for the createdRole
.Sets the reason to show in the audit logs when the spec is built.
-
Constructor Details
-
LegacyRoleCreateSpec
public LegacyRoleCreateSpec()
-
-
Method Details
-
setName
Sets the name of the createdRole
.- Parameters:
name
- The role name.- Returns:
- This spec.
-
setPermissions
Sets the enabled/disabled permissions, in the form of aPermissionSet
for the createdRole
.- Parameters:
permissions
- The role permissions.- Returns:
- This spec.
-
setColor
Sets the color of the createdRole
.- Parameters:
color
- The role color.- Returns:
- This spec.
-
setHoist
Sets whether the createdRole
should be displayed separately in the sidebar.- Parameters:
hoist
- The role hoisted property.- Returns:
- This spec.
-
setMentionable
Sets whether the createdRole
should be mentionable.- Parameters:
mentionable
- The role mentionable property.- Returns:
- This spec.
-
setReason
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.RoleCreateRequest>
- Parameters:
reason
- The audit log reason.- Returns:
- This spec.
-
getReason
Description copied from interface:LegacyAuditSpec
Returns the current audit log reason set on the spec.- Specified by:
getReason
in interfaceLegacyAuditSpec<discord4j.discordjson.json.RoleCreateRequest>
- Returns:
- The current audit log reason.
-
asRequest
public discord4j.discordjson.json.RoleCreateRequest asRequest()- Specified by:
asRequest
in interfaceLegacySpec<discord4j.discordjson.json.RoleCreateRequest>
-