Package discord4j.core.spec
Class RoleCreateSpec
- java.lang.Object
-
- discord4j.core.spec.RoleCreateSpec
-
- All Implemented Interfaces:
AuditSpec<discord4j.discordjson.json.RoleCreateRequest>
,Spec<discord4j.discordjson.json.RoleCreateRequest>
public class RoleCreateSpec extends Object implements AuditSpec<discord4j.discordjson.json.RoleCreateRequest>
Spec used to create a new guildRole
entity.- See Also:
- Create Guild Role
-
-
Constructor Summary
Constructors Constructor Description RoleCreateSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description discord4j.discordjson.json.RoleCreateRequest
asRequest()
String
getReason()
Returns the current audit log reason set on the spec.RoleCreateSpec
setColor(Color color)
Sets the color of the createdRole
.RoleCreateSpec
setHoist(boolean hoist)
Sets whether the createdRole
should be displayed separately in the sidebar.RoleCreateSpec
setMentionable(boolean mentionable)
Sets whether the createdRole
should be mentionable.RoleCreateSpec
setName(String name)
Sets the name of the createdRole
.RoleCreateSpec
setPermissions(PermissionSet permissions)
Sets the enabled/disabled permissions, in the form of aPermissionSet
for the createdRole
.RoleCreateSpec
setReason(String reason)
Sets the reason to show in the audit logs when the spec is built.
-
-
-
Method Detail
-
setName
public RoleCreateSpec setName(String name)
Sets the name of the createdRole
.- Parameters:
name
- The role name.- Returns:
- This spec.
-
setPermissions
public RoleCreateSpec setPermissions(PermissionSet permissions)
Sets the enabled/disabled permissions, in the form of aPermissionSet
for the createdRole
.- Parameters:
permissions
- The role permissions.- Returns:
- This spec.
-
setColor
public RoleCreateSpec setColor(Color color)
Sets the color of the createdRole
.- Parameters:
color
- The role color.- Returns:
- This spec.
-
setHoist
public RoleCreateSpec setHoist(boolean hoist)
Sets whether the createdRole
should be displayed separately in the sidebar.- Parameters:
hoist
- The role hoisted property.- Returns:
- This spec.
-
setMentionable
public RoleCreateSpec setMentionable(boolean mentionable)
Sets whether the createdRole
should be mentionable.- Parameters:
mentionable
- The role mentionable property.- Returns:
- This spec.
-
setReason
public RoleCreateSpec setReason(@Nullable String reason)
Description copied from interface:AuditSpec
Sets the reason to show in the audit logs when the spec is built.
-
getReason
@Nullable public String getReason()
Description copied from interface:AuditSpec
Returns the current audit log reason set on the spec.
-
-