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.RoleModifyRequestasRequest()StringgetReason()Returns the current audit log reason set on the spec.LegacyRoleEditSpecsetColor(Color color)Sets the new color of theRole.LegacyRoleEditSpecsetHoist(boolean hoist)Sets whether the modifiedRoleshould be displayed separately in the sidebar.LegacyRoleEditSpecsetMentionable(boolean mentionable)Sets whether the modifiedRoleshould be mentionable.LegacyRoleEditSpecsetName(String name)Sets the new name of theRole.LegacyRoleEditSpecsetPermissions(PermissionSet permissions)Sets the new permissions for theRole.LegacyRoleEditSpecsetReason(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 modifiedRoleshould be displayed separately in the sidebar.- Parameters:
hoist- The role hoisted property.- Returns:
- This spec.
-
setMentionable
public LegacyRoleEditSpec setMentionable(boolean mentionable)
Sets whether the modifiedRoleshould be mentionable.- Parameters:
mentionable- The role mentionable property.- Returns:
- This spec.
-
setReason
public LegacyRoleEditSpec 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.RoleModifyRequest>- 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.RoleModifyRequest>- Returns:
- The current audit log reason.
-
asRequest
public discord4j.discordjson.json.RoleModifyRequest asRequest()
- Specified by:
asRequestin interfaceLegacySpec<discord4j.discordjson.json.RoleModifyRequest>
-
-