Skip to content

Commit f0007b8

Browse files
committed
2 parents e26beed + 4900f5a commit f0007b8

File tree

149 files changed

+718
-633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+718
-633
lines changed

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,91 @@ Check out the [Documentation](https://lc4.gitbook.io/lavalink-client) | or the [
102102

103103
- 😁 Much much more!
104104

105+
***
106+
107+
# All Events:
108+
109+
## On **Lavalink-Manager**:
110+
> *Player related logs*
111+
- `playerCreate` ➡️ `(player) => {}`
112+
- `playerDestroy` ➡️ `(player, reason) => {}`
113+
- `playerDisconnect` ➡️ `(player, voiceChannelId) => {}`
114+
- `playerMove` ➡️ `(player, oldChannelId, newChannelId) => {}`
115+
- Updating the voice channel is handled by the client automatically
116+
- `playerSocketClosed` ➡️ `(player, payload) => {}`
117+
118+
> *Track / Manager related logs*
119+
- `trackStart` ➡️ `(player, track, payload) => {}`
120+
- `trackStuck` ➡️ `(player, track, payload) => {}`
121+
- `trackError` ➡️ `(player, track, payload) => {}`
122+
- `trackEnd` ➡️ `(player, track, payload) => {}`
123+
- `queueEnd` ➡️ `(player, track, payload) => {}`
124+
- `playerUpdate` ➡️ `(player) => {}`
125+
126+
```js
127+
client.lavalink.on("create", (node, payload) => {
128+
console.log(`The Lavalink Node #${node.id} connected`);
129+
});
130+
// for all node based errors:
131+
client.lavalink.on("error", (node, error, payload) => {
132+
console.error(`The Lavalink Node #${node.id} errored: `, error);
133+
console.error(`Error-Payload: `, payload)
134+
});
135+
```
136+
137+
## On **Node-Manager**:
138+
- `raw` ➡️ `(node, payload) => {}`
139+
- `disconnect` ➡️ `(node, reason) => {}`
140+
- `connect` ➡️ `(node) => {}`
141+
- `reconnecting` ➡️ `(node) => {}`
142+
- `create` ➡️ `(node) => {}`
143+
- `destroy` ➡️ `(node) => {}`
144+
- `error` ➡️ `(node, error, payload) => {}`
145+
- `resumed` ➡️ `(node, payload, players) => {}`
146+
- Resuming needs to be handled manually by you *(aka add the players to the manager)*
147+
- e.g.:
148+
```js
149+
client.lavalink.nodeManager.on("create", (node, payload) => {
150+
console.log(`The Lavalink Node #${node.id} connected`);
151+
});
152+
// for all node based errors:
153+
client.lavalink.nodeManager.on("error", (node, error, payload) => {
154+
console.error(`The Lavalink Node #${node.id} errored: `, error);
155+
console.error(`Error-Payload: `, payload)
156+
});
157+
```
158+
159+
## How to log queue logs?
160+
> When creating the manager, add the option: `queueOptions.queueChangesWatcher: new myCustomWatcher(botClient)`
161+
> E.g:
162+
```js
163+
import { QueueChangesWatcher, LavalinkManager } from "lavalink-client";
164+
165+
class myCustomWatcher implements QueueChangesWatcher {
166+
constructor(client) {
167+
this.client = client;
168+
}
169+
shuffled(guildId, oldStoredQueue, newStoredQueue) {
170+
console.log(`${this.client.guilds.cache.get(guildId)?.name || guildId}: Queue got shuffled`)
171+
}
172+
tracksAdd(guildId, tracks, position, oldStoredQueue, newStoredQueue) {
173+
console.log(`${this.client.guilds.cache.get(guildId)?.name || guildId}: ${tracks.length} Tracks got added into the Queue at position #${position}`);
174+
}
175+
tracksRemoved(guildId, tracks, position, oldStoredQueue, newStoredQueue) {
176+
console.log(`${this.client.guilds.cache.get(guildId)?.name || guildId}: ${tracks.length} Tracks got removed from the Queue at position #${position}`);
177+
}
178+
}
179+
180+
client.lavalink = new LavalinkManager({
181+
// ... other options
182+
queueOptions: {
183+
queueChangesWatcher: new myCustomWatcher(client)
184+
}
185+
})
186+
```
187+
188+
***
189+
105190
# UpdateLog
106191
107192
## **Version 1.2.0**

dist/cjs/structures/Filters.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,27 +61,27 @@ export declare class FilterManager {
6161
*/
6262
setRate(rate?: number): Promise<boolean>;
6363
/**
64-
* Enabels / Disables the rotation effect, (Optional: provide your Own Data)
64+
* Enables / Disables the rotation effect, (Optional: provide your Own Data)
6565
* @param rotationHz
6666
* @returns
6767
*/
6868
toggleRotation(rotationHz?: number): Promise<boolean>;
6969
/**
70-
* Enabels / Disables the Vibrato effect, (Optional: provide your Own Data)
70+
* Enables / Disables the Vibrato effect, (Optional: provide your Own Data)
7171
* @param frequency
7272
* @param depth
7373
* @returns
7474
*/
7575
toggleVibrato(frequency?: number, depth?: number): Promise<boolean>;
7676
/**
77-
* Enabels / Disables the Tremolo effect, (Optional: provide your Own Data)
77+
* Enables / Disables the Tremolo effect, (Optional: provide your Own Data)
7878
* @param frequency
7979
* @param depth
8080
* @returns
8181
*/
8282
toggleTremolo(frequency?: number, depth?: number): Promise<boolean>;
8383
/**
84-
* Enabels / Disables the LowPass effect, (Optional: provide your Own Data)
84+
* Enables / Disables the LowPass effect, (Optional: provide your Own Data)
8585
* @param smoothing
8686
* @returns
8787
*/
@@ -94,30 +94,30 @@ export declare class FilterManager {
9494
};
9595
lavalinkFilterPlugin: {
9696
/**
97-
* Enabels / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
97+
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
9898
* @param delay
9999
* @param decay
100100
* @returns
101101
*/
102102
toggleEcho: (delay?: number, decay?: number) => Promise<boolean>;
103103
/**
104-
* Enabels / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
104+
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
105105
* @param delays
106106
* @param gains
107107
* @returns
108108
*/
109109
toggleReverb: (delays?: number[], gains?: number[]) => Promise<boolean>;
110110
};
111111
/**
112-
* Enables / Disabels a Nightcore-like filter Effect. Disables/Overwrides both: custom and Vaporwave Filter
112+
* Enables / Disables a Nightcore-like filter Effect. Disables/Overrides both: custom and Vaporwave Filter
113113
* @param speed
114114
* @param pitch
115115
* @param rate
116116
* @returns
117117
*/
118118
toggleNightcore(speed?: number, pitch?: number, rate?: number): Promise<boolean>;
119119
/**
120-
* Enables / Disabels a Vaporwave-like filter Effect. Disables/Overwrides both: custom and nightcore Filter
120+
* Enables / Disables a Vaporwave-like filter Effect. Disables/Overrides both: custom and nightcore Filter
121121
* @param speed
122122
* @param pitch
123123
* @param rate

dist/cjs/structures/Filters.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class FilterManager {
374374
return this.filters.custom;
375375
}
376376
/**
377-
* Enabels / Disables the rotation effect, (Optional: provide your Own Data)
377+
* Enables / Disables the rotation effect, (Optional: provide your Own Data)
378378
* @param rotationHz
379379
* @returns
380380
*/
@@ -386,7 +386,7 @@ class FilterManager {
386386
return await this.applyPlayerFilters(), this.filters.rotation;
387387
}
388388
/**
389-
* Enabels / Disables the Vibrato effect, (Optional: provide your Own Data)
389+
* Enables / Disables the Vibrato effect, (Optional: provide your Own Data)
390390
* @param frequency
391391
* @param depth
392392
* @returns
@@ -401,7 +401,7 @@ class FilterManager {
401401
return this.filters.vibrato;
402402
}
403403
/**
404-
* Enabels / Disables the Tremolo effect, (Optional: provide your Own Data)
404+
* Enables / Disables the Tremolo effect, (Optional: provide your Own Data)
405405
* @param frequency
406406
* @param depth
407407
* @returns
@@ -416,7 +416,7 @@ class FilterManager {
416416
return this.filters.tremolo;
417417
}
418418
/**
419-
* Enabels / Disables the LowPass effect, (Optional: provide your Own Data)
419+
* Enables / Disables the LowPass effect, (Optional: provide your Own Data)
420420
* @param smoothing
421421
* @returns
422422
*/
@@ -528,7 +528,7 @@ class FilterManager {
528528
};
529529
lavalinkFilterPlugin = {
530530
/**
531-
* Enabels / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
531+
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
532532
* @param delay
533533
* @param decay
534534
* @returns
@@ -553,7 +553,7 @@ class FilterManager {
553553
return this.filters.lavalinkFilterPlugin.echo;
554554
},
555555
/**
556-
* Enabels / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
556+
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
557557
* @param delays
558558
* @param gains
559559
* @returns
@@ -579,7 +579,7 @@ class FilterManager {
579579
}
580580
};
581581
/**
582-
* Enables / Disabels a Nightcore-like filter Effect. Disables/Overwrides both: custom and Vaporwave Filter
582+
* Enables / Disables a Nightcore-like filter Effect. Disables/Overrides both: custom and Vaporwave Filter
583583
* @param speed
584584
* @param pitch
585585
* @param rate
@@ -598,7 +598,7 @@ class FilterManager {
598598
return this.filters.nightcore;
599599
}
600600
/**
601-
* Enables / Disabels a Vaporwave-like filter Effect. Disables/Overwrides both: custom and nightcore Filter
601+
* Enables / Disables a Vaporwave-like filter Effect. Disables/Overrides both: custom and nightcore Filter
602602
* @param speed
603603
* @param pitch
604604
* @param rate

dist/esm/structures/Filters.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,27 +61,27 @@ export declare class FilterManager {
6161
*/
6262
setRate(rate?: number): Promise<boolean>;
6363
/**
64-
* Enabels / Disables the rotation effect, (Optional: provide your Own Data)
64+
* Enables / Disables the rotation effect, (Optional: provide your Own Data)
6565
* @param rotationHz
6666
* @returns
6767
*/
6868
toggleRotation(rotationHz?: number): Promise<boolean>;
6969
/**
70-
* Enabels / Disables the Vibrato effect, (Optional: provide your Own Data)
70+
* Enables / Disables the Vibrato effect, (Optional: provide your Own Data)
7171
* @param frequency
7272
* @param depth
7373
* @returns
7474
*/
7575
toggleVibrato(frequency?: number, depth?: number): Promise<boolean>;
7676
/**
77-
* Enabels / Disables the Tremolo effect, (Optional: provide your Own Data)
77+
* Enables / Disables the Tremolo effect, (Optional: provide your Own Data)
7878
* @param frequency
7979
* @param depth
8080
* @returns
8181
*/
8282
toggleTremolo(frequency?: number, depth?: number): Promise<boolean>;
8383
/**
84-
* Enabels / Disables the LowPass effect, (Optional: provide your Own Data)
84+
* Enables / Disables the LowPass effect, (Optional: provide your Own Data)
8585
* @param smoothing
8686
* @returns
8787
*/
@@ -94,30 +94,30 @@ export declare class FilterManager {
9494
};
9595
lavalinkFilterPlugin: {
9696
/**
97-
* Enabels / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
97+
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
9898
* @param delay
9999
* @param decay
100100
* @returns
101101
*/
102102
toggleEcho: (delay?: number, decay?: number) => Promise<boolean>;
103103
/**
104-
* Enabels / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
104+
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
105105
* @param delays
106106
* @param gains
107107
* @returns
108108
*/
109109
toggleReverb: (delays?: number[], gains?: number[]) => Promise<boolean>;
110110
};
111111
/**
112-
* Enables / Disabels a Nightcore-like filter Effect. Disables/Overwrides both: custom and Vaporwave Filter
112+
* Enables / Disables a Nightcore-like filter Effect. Disables/Overrides both: custom and Vaporwave Filter
113113
* @param speed
114114
* @param pitch
115115
* @param rate
116116
* @returns
117117
*/
118118
toggleNightcore(speed?: number, pitch?: number, rate?: number): Promise<boolean>;
119119
/**
120-
* Enables / Disabels a Vaporwave-like filter Effect. Disables/Overwrides both: custom and nightcore Filter
120+
* Enables / Disables a Vaporwave-like filter Effect. Disables/Overrides both: custom and nightcore Filter
121121
* @param speed
122122
* @param pitch
123123
* @param rate

dist/esm/structures/Filters.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ export class FilterManager {
371371
return this.filters.custom;
372372
}
373373
/**
374-
* Enabels / Disables the rotation effect, (Optional: provide your Own Data)
374+
* Enables / Disables the rotation effect, (Optional: provide your Own Data)
375375
* @param rotationHz
376376
* @returns
377377
*/
@@ -383,7 +383,7 @@ export class FilterManager {
383383
return await this.applyPlayerFilters(), this.filters.rotation;
384384
}
385385
/**
386-
* Enabels / Disables the Vibrato effect, (Optional: provide your Own Data)
386+
* Enables / Disables the Vibrato effect, (Optional: provide your Own Data)
387387
* @param frequency
388388
* @param depth
389389
* @returns
@@ -398,7 +398,7 @@ export class FilterManager {
398398
return this.filters.vibrato;
399399
}
400400
/**
401-
* Enabels / Disables the Tremolo effect, (Optional: provide your Own Data)
401+
* Enables / Disables the Tremolo effect, (Optional: provide your Own Data)
402402
* @param frequency
403403
* @param depth
404404
* @returns
@@ -413,7 +413,7 @@ export class FilterManager {
413413
return this.filters.tremolo;
414414
}
415415
/**
416-
* Enabels / Disables the LowPass effect, (Optional: provide your Own Data)
416+
* Enables / Disables the LowPass effect, (Optional: provide your Own Data)
417417
* @param smoothing
418418
* @returns
419419
*/
@@ -525,7 +525,7 @@ export class FilterManager {
525525
};
526526
lavalinkFilterPlugin = {
527527
/**
528-
* Enabels / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
528+
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
529529
* @param delay
530530
* @param decay
531531
* @returns
@@ -550,7 +550,7 @@ export class FilterManager {
550550
return this.filters.lavalinkFilterPlugin.echo;
551551
},
552552
/**
553-
* Enabels / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
553+
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
554554
* @param delays
555555
* @param gains
556556
* @returns
@@ -576,7 +576,7 @@ export class FilterManager {
576576
}
577577
};
578578
/**
579-
* Enables / Disabels a Nightcore-like filter Effect. Disables/Overwrides both: custom and Vaporwave Filter
579+
* Enables / Disables a Nightcore-like filter Effect. Disables/Overrides both: custom and Vaporwave Filter
580580
* @param speed
581581
* @param pitch
582582
* @param rate
@@ -595,7 +595,7 @@ export class FilterManager {
595595
return this.filters.nightcore;
596596
}
597597
/**
598-
* Enables / Disabels a Vaporwave-like filter Effect. Disables/Overwrides both: custom and nightcore Filter
598+
* Enables / Disables a Vaporwave-like filter Effect. Disables/Overrides both: custom and nightcore Filter
599599
* @param speed
600600
* @param pitch
601601
* @param rate

0 commit comments

Comments
 (0)