lavalink-client 2.9.8 → 2.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -2
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -589,11 +589,12 @@ var QueueSymbol = /* @__PURE__ */ Symbol("LC-Queue");
|
|
|
589
589
|
var NodeSymbol = /* @__PURE__ */ Symbol("LC-Node");
|
|
590
590
|
var escapeRegExp = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
591
591
|
function parseLavalinkConnUrl(connectionUrl) {
|
|
592
|
-
if (!connectionUrl.startsWith("lavalink://"))
|
|
593
|
-
throw new Error(`ConnectionUrl (${connectionUrl}) must start with 'lavalink://'`);
|
|
592
|
+
if (!connectionUrl.startsWith("lavalink://") && !connectionUrl.startsWith("nodelink://"))
|
|
593
|
+
throw new Error(`ConnectionUrl (${connectionUrl}) must start with 'lavalink://' or 'nodelink://'`);
|
|
594
594
|
const parsed = new import_node_url.URL(connectionUrl);
|
|
595
595
|
return {
|
|
596
596
|
authorization: parsed.password,
|
|
597
|
+
nodeType: connectionUrl.startsWith("lavalink://") ? "Lavalink" : "NodeLink",
|
|
597
598
|
id: parsed.username,
|
|
598
599
|
host: parsed.hostname,
|
|
599
600
|
port: Number(parsed.port)
|
package/dist/index.d.cts
CHANGED
|
@@ -404,12 +404,13 @@ declare const UnresolvedTrackSymbol: unique symbol;
|
|
|
404
404
|
declare const QueueSymbol: unique symbol;
|
|
405
405
|
declare const NodeSymbol: unique symbol;
|
|
406
406
|
/**
|
|
407
|
-
* Parses Node Connection Url: "lavalink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort>"
|
|
407
|
+
* Parses Node Connection Url: "lavalink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort>" or "nodelink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort>"
|
|
408
408
|
* @param connectionUrl
|
|
409
409
|
* @returns
|
|
410
410
|
*/
|
|
411
411
|
declare function parseLavalinkConnUrl(connectionUrl: string): {
|
|
412
412
|
authorization: string;
|
|
413
|
+
nodeType: NodeTypes;
|
|
413
414
|
id: string;
|
|
414
415
|
host: string;
|
|
415
416
|
port: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -404,12 +404,13 @@ declare const UnresolvedTrackSymbol: unique symbol;
|
|
|
404
404
|
declare const QueueSymbol: unique symbol;
|
|
405
405
|
declare const NodeSymbol: unique symbol;
|
|
406
406
|
/**
|
|
407
|
-
* Parses Node Connection Url: "lavalink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort>"
|
|
407
|
+
* Parses Node Connection Url: "lavalink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort>" or "nodelink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort>"
|
|
408
408
|
* @param connectionUrl
|
|
409
409
|
* @returns
|
|
410
410
|
*/
|
|
411
411
|
declare function parseLavalinkConnUrl(connectionUrl: string): {
|
|
412
412
|
authorization: string;
|
|
413
|
+
nodeType: NodeTypes;
|
|
413
414
|
id: string;
|
|
414
415
|
host: string;
|
|
415
416
|
port: number;
|
package/dist/index.js
CHANGED
|
@@ -525,11 +525,12 @@ var QueueSymbol = /* @__PURE__ */ Symbol("LC-Queue");
|
|
|
525
525
|
var NodeSymbol = /* @__PURE__ */ Symbol("LC-Node");
|
|
526
526
|
var escapeRegExp = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
527
527
|
function parseLavalinkConnUrl(connectionUrl) {
|
|
528
|
-
if (!connectionUrl.startsWith("lavalink://"))
|
|
529
|
-
throw new Error(`ConnectionUrl (${connectionUrl}) must start with 'lavalink://'`);
|
|
528
|
+
if (!connectionUrl.startsWith("lavalink://") && !connectionUrl.startsWith("nodelink://"))
|
|
529
|
+
throw new Error(`ConnectionUrl (${connectionUrl}) must start with 'lavalink://' or 'nodelink://'`);
|
|
530
530
|
const parsed = new URL2(connectionUrl);
|
|
531
531
|
return {
|
|
532
532
|
authorization: parsed.password,
|
|
533
|
+
nodeType: connectionUrl.startsWith("lavalink://") ? "Lavalink" : "NodeLink",
|
|
533
534
|
id: parsed.username,
|
|
534
535
|
host: parsed.hostname,
|
|
535
536
|
port: Number(parsed.port)
|
package/dist/index.mjs
CHANGED
|
@@ -525,11 +525,12 @@ var QueueSymbol = /* @__PURE__ */ Symbol("LC-Queue");
|
|
|
525
525
|
var NodeSymbol = /* @__PURE__ */ Symbol("LC-Node");
|
|
526
526
|
var escapeRegExp = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
527
527
|
function parseLavalinkConnUrl(connectionUrl) {
|
|
528
|
-
if (!connectionUrl.startsWith("lavalink://"))
|
|
529
|
-
throw new Error(`ConnectionUrl (${connectionUrl}) must start with 'lavalink://'`);
|
|
528
|
+
if (!connectionUrl.startsWith("lavalink://") && !connectionUrl.startsWith("nodelink://"))
|
|
529
|
+
throw new Error(`ConnectionUrl (${connectionUrl}) must start with 'lavalink://' or 'nodelink://'`);
|
|
530
530
|
const parsed = new URL2(connectionUrl);
|
|
531
531
|
return {
|
|
532
532
|
authorization: parsed.password,
|
|
533
|
+
nodeType: connectionUrl.startsWith("lavalink://") ? "Lavalink" : "NodeLink",
|
|
533
534
|
id: parsed.username,
|
|
534
535
|
host: parsed.hostname,
|
|
535
536
|
port: Number(parsed.port)
|
package/package.json
CHANGED