Class RoleEditSpec

  • All Implemented Interfaces:
    AuditSpec<discord4j.discordjson.json.RoleModifyRequest>, Spec<discord4j.discordjson.json.RoleModifyRequest>

    public class RoleEditSpec
    extends Object
    implements AuditSpec<discord4j.discordjson.json.RoleModifyRequest>
    Spec used to modify a guild Role.
    See Also:
    Modify Guild Role
    • Constructor Detail

      • RoleEditSpec

        public RoleEditSpec()
    • Method Detail

      • setName

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

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

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

        public RoleEditSpec 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 RoleEditSpec setMentionable​(boolean mentionable)
        Sets whether the modified Role should be mentionable.
        Parameters:
        mentionable - The role mentionable property.
        Returns:
        This spec.
      • setReason

        public RoleEditSpec setReason​(@Nullable
                                      String reason)
        Description copied from interface: AuditSpec
        Sets the reason to show in the audit logs when the spec is built.
        Specified by:
        setReason in interface AuditSpec<discord4j.discordjson.json.RoleModifyRequest>
        Parameters:
        reason - The audit log reason.
        Returns:
        This spec.
      • getReason

        @Nullable
        public String getReason()
        Description copied from interface: AuditSpec
        Returns the current audit log reason set on the spec.
        Specified by:
        getReason in interface AuditSpec<discord4j.discordjson.json.RoleModifyRequest>
        Returns:
        The current audit log reason.
      • asRequest

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