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 guild Role.
See Also:
  • Constructor Details

    • LegacyRoleEditSpec

      public LegacyRoleEditSpec()
  • Method Details

    • setName

      public LegacyRoleEditSpec setName(String name)
      Sets the new name of the Role.
      Parameters:
      name - The role name.
      Returns:
      This spec.
    • setPermissions

      public LegacyRoleEditSpec setPermissions(PermissionSet permissions)
      Sets the new permissions for the Role.
      Parameters:
      permissions - The role permissions.
      Returns:
      This spec.
    • setColor

      public LegacyRoleEditSpec setColor(Color color)
      Sets the new color of the Role.
      Parameters:
      color - The role color.
      Returns:
      This spec.
    • setHoist

      public LegacyRoleEditSpec setHoist(boolean hoist)
      Sets whether the modified Role 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 modified Role 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 interface LegacyAuditSpec<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 interface LegacyAuditSpec<discord4j.discordjson.json.RoleModifyRequest>
      Returns:
      The current audit log reason.
    • asRequest

      public discord4j.discordjson.json.RoleModifyRequest asRequest()
      Specified by:
      asRequest in interface LegacySpec<discord4j.discordjson.json.RoleModifyRequest>