lavalink-client 2.9.10 → 2.10.0

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/README.md CHANGED
@@ -111,8 +111,16 @@ pnpm add tomato6966/lavalink-client
111
111
 
112
112
  This client can be used with nodelink too, but because nodelink's websocket is different than the one from lavalink, you need to disable a few things on the NODE OPTIONS / NODE PROPERTIES:
113
113
 
114
+ Import the NodeType Enum:
115
+
116
+ ```
117
+ import { NodeType } from "lavalink-client"
118
+ ```
119
+
120
+ // You must assign NodeLink enum to nodeType of the node options, before creating the node.
121
+
114
122
  ```ts
115
- nodeOptions.nodeType = "NodeLink";
123
+ nodeOptions.nodeType = NodeType.NodeLink;
116
124
  ```
117
125
 
118
126
  this can be done directly when creating the node in the lavalinkmanager.
@@ -122,7 +130,7 @@ client.lavalink = new LavalinkManager({
122
130
  nodes: [
123
131
  {
124
132
  host: "localhost",
125
- nodeType: "NodeLink",
133
+ nodeType: NodeType.NodeLink, // provide nodeType "nodelink" to it.
126
134
  },
127
135
  ],
128
136
  });
@@ -135,8 +143,10 @@ client.lavalink = new LavalinkManager({
135
143
  port: 2333,
136
144
  id: "Main Node",
137
145
  // set to nodeLink
138
- nodeType: "NodeLink",
146
+ nodeType: NodeType.NodeLink, // provide it here
139
147
  },
148
+ // you can also use the util like this, and it will return a valid node option object. must start with: lavalink:// | nodelink://
149
+ // parseLavalinkConnUrl("nodelink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort>")
140
150
  ],
141
151
  // A function to send voice server updates to the Lavalink client
142
152
  sendToShard: (guildId, payload) => {
@@ -392,6 +402,8 @@ client.lavalink = new LavalinkManager({
392
402
  port: 2333,
393
403
  id: "Main Node",
394
404
  },
405
+ // you can also use the util like this, and it will return a valid node option object.
406
+ // parseLavalinkConnUrl("nodelink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort>")
395
407
  ],
396
408
  // A function to send voice server updates to the Lavalink client
397
409
  sendToShard: (guildId, payload) => {
@@ -448,6 +460,8 @@ client.lavalink = new LavalinkManager({
448
460
  retryAmount: 5,
449
461
  retryDelay: 10_000, // 10 seconds
450
462
  },
463
+ // you can also use the util like this, and it will return a valid node option object. must start with: lavalink:// | nodelink://
464
+ // parseLavalinkConnUrl("lavalink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort>")
451
465
  ],
452
466
  sendToShard: (guildId, payload) => client.guilds.cache.get(guildId)?.shard?.send(payload),
453
467
  autoSkip: true, // automatically play the next song of the queue, on: trackend, trackerror, trackexception