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 guildRoleentity.- See Also:
- Create Guild Role
-
-
Constructor Summary
Constructors Constructor Description LegacyRoleCreateSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description discord4j.discordjson.json.RoleCreateRequestasRequest()StringgetReason()Returns the current audit log reason set on the spec.LegacyRoleCreateSpecsetColor(Color color)Sets the color of the createdRole.LegacyRoleCreateSpecsetHoist(boolean hoist)Sets whether the createdRoleshould be displayed separately in the sidebar.LegacyRoleCreateSpecsetMentionable(boolean mentionable)Sets whether the createdRoleshould be mentionable.LegacyRoleCreateSpecsetName(String name)Sets the name of the createdRole.LegacyRoleCreateSpecsetPermissions(PermissionSet permissions)Sets the enabled/disabled permissions, in the form of aPermissionSetfor the createdRole.LegacyRoleCreateSpecsetReason(String reason)Sets the reason to show in the audit logs when the spec is built.
-
-
-
Method Detail
-
setName
public LegacyRoleCreateSpec setName(String name)
Sets the name of the createdRole.- Parameters:
name- The role name.- Returns:
- This spec.
-
setPermissions
public LegacyRoleCreateSpec setPermissions(PermissionSet permissions)
Sets the enabled/disabled permissions, in the form of aPermissionSetfor the createdRole.- Parameters:
permissions- The role permissions.- Returns:
- This spec.
-
setColor
public LegacyRoleCreateSpec setColor(Color color)
Sets the color of the createdRole.- Parameters:
color- The role color.- Returns:
- This spec.
-
setHoist
public LegacyRoleCreateSpec setHoist(boolean hoist)
Sets whether the createdRoleshould be displayed separately in the sidebar.- Parameters:
hoist- The role hoisted property.- Returns:
- This spec.
-
setMentionable
public LegacyRoleCreateSpec setMentionable(boolean mentionable)
Sets whether the createdRoleshould be mentionable.- Parameters:
mentionable- The role mentionable property.- Returns:
- This spec.
-
setReason
public LegacyRoleCreateSpec 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.RoleCreateRequest>- 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.RoleCreateRequest>- Returns:
- The current audit log reason.
-
asRequest
public discord4j.discordjson.json.RoleCreateRequest asRequest()
- Specified by:
asRequestin interfaceLegacySpec<discord4j.discordjson.json.RoleCreateRequest>
-
-