1.0.2 • Published 5 years ago

@lavaclient/rest v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Lavaclient REST

A lavaclient plugin that adds Lavalink REST Functionality to both the Socket and Manager.

  • ✅ Verified: This is a verified Lavaclient plugin.

Support Github

Installation

npm install lavaclient-rest

Setup

This only works with lavaclient 3.x.x

import { Manager } from "lavaclient";
import { RESTPlugin } from "@lavaclient/rest";

const manager = new Manager(...);
manager.use(new RESTPlugin());

// Or

const manager = new Manager(..., {
  plugins: [new RESTPlugin()],
  ...
});

// Now:
(async () => {
  const { rest } = manager.ideal[0]; // Gets the first ideal node.
  await rest.resolve("ytsearch:Joji - Gimme Love");
  await rest.decode("...");
  await rest.routePlannerStatus();
  await rest.unmarkFailingAddress("...");
  await rest.unmarkAllFailingAddresses();
})();