lavalink-client 2.5.4 → 2.5.6
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/cjs/structures/Filters.js +1 -1
- package/dist/cjs/structures/Node.js +5 -1
- package/dist/cjs/structures/Player.d.ts +1 -3
- package/dist/cjs/structures/Player.js +2 -4
- package/dist/esm/structures/Filters.js +1 -1
- package/dist/esm/structures/Node.js +5 -1
- package/dist/esm/structures/Player.d.ts +1 -3
- package/dist/esm/structures/Player.js +2 -4
- package/dist/types/structures/Player.d.ts +1 -3
- package/package.json +1 -1
|
@@ -694,7 +694,7 @@ class FilterManager {
|
|
|
694
694
|
}
|
|
695
695
|
/** Clears the equalizer bands. */
|
|
696
696
|
async clearEQ() {
|
|
697
|
-
return this.setEQ(Array.from({ length: 15 }, () => ({ band:
|
|
697
|
+
return this.setEQ(Array.from({ length: 15 }, (_v, i) => ({ band: i, gain: 0 })));
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
700
|
exports.FilterManager = FilterManager;
|
|
@@ -133,6 +133,8 @@ class LavalinkNode {
|
|
|
133
133
|
const { response, options } = await this.rawRequest(endpoint, modify);
|
|
134
134
|
if (["DELETE", "PUT"].includes(options.method))
|
|
135
135
|
return;
|
|
136
|
+
if (response.status === 204)
|
|
137
|
+
return; // no content
|
|
136
138
|
if (response.status === 404)
|
|
137
139
|
throw new Error(`Node Request resulted into an error, request-PATH: ${options.path} | headers: ${(0, Utils_1.safeStringify)(response.headers)}`);
|
|
138
140
|
return parseAsText ? await response.text() : await response.json();
|
|
@@ -730,7 +732,9 @@ class LavalinkNode {
|
|
|
730
732
|
if (!this.info.plugins.find(v => v.name === "lavasrc-plugin") &&
|
|
731
733
|
!this.info.plugins.find(v => v.name === "java-lyrics-plugin"))
|
|
732
734
|
throw new RangeError(`there is no lyrics source (via lavasrc-plugin / java-lyrics-plugin) available in the lavalink node (required for lyrics): ${this.id}`);
|
|
733
|
-
return await this.request(`/sessions/${this.sessionId}/players/${guildId}/
|
|
735
|
+
return await this.request(`/sessions/${this.sessionId}/players/${guildId}/lyrics/subscribe`, (options) => {
|
|
736
|
+
options.method = "DELETE";
|
|
737
|
+
});
|
|
734
738
|
},
|
|
735
739
|
};
|
|
736
740
|
/**
|
|
@@ -196,7 +196,6 @@ export declare class Player {
|
|
|
196
196
|
getLyrics(track: Track, skipTrackSource?: boolean): Promise<import("./Types/Node.js").LyricsResult>;
|
|
197
197
|
/**
|
|
198
198
|
* Subscribe to the lyrics event on a specific guild to active live lyrics events
|
|
199
|
-
* @param guildId The guild id to subscribe to
|
|
200
199
|
* @returns The unsubscribe function
|
|
201
200
|
* @example
|
|
202
201
|
* ```ts
|
|
@@ -206,14 +205,13 @@ export declare class Player {
|
|
|
206
205
|
subscribeLyrics(): Promise<unknown>;
|
|
207
206
|
/**
|
|
208
207
|
* Unsubscribe from the lyrics event on a specific guild to disable live lyrics events
|
|
209
|
-
* @param guildId The guild id to unsubscribe from
|
|
210
208
|
* @returns The unsubscribe function
|
|
211
209
|
* @example
|
|
212
210
|
* ```ts
|
|
213
211
|
* const lyrics = await player.unsubscribeLyrics();
|
|
214
212
|
* ```
|
|
215
213
|
*/
|
|
216
|
-
unsubscribeLyrics(
|
|
214
|
+
unsubscribeLyrics(): Promise<void>;
|
|
217
215
|
/**
|
|
218
216
|
* Move the player on a different Audio-Node
|
|
219
217
|
* @param newNode New Node / New Node Id
|
|
@@ -631,7 +631,6 @@ class Player {
|
|
|
631
631
|
}
|
|
632
632
|
/**
|
|
633
633
|
* Subscribe to the lyrics event on a specific guild to active live lyrics events
|
|
634
|
-
* @param guildId The guild id to subscribe to
|
|
635
634
|
* @returns The unsubscribe function
|
|
636
635
|
* @example
|
|
637
636
|
* ```ts
|
|
@@ -643,15 +642,14 @@ class Player {
|
|
|
643
642
|
}
|
|
644
643
|
/**
|
|
645
644
|
* Unsubscribe from the lyrics event on a specific guild to disable live lyrics events
|
|
646
|
-
* @param guildId The guild id to unsubscribe from
|
|
647
645
|
* @returns The unsubscribe function
|
|
648
646
|
* @example
|
|
649
647
|
* ```ts
|
|
650
648
|
* const lyrics = await player.unsubscribeLyrics();
|
|
651
649
|
* ```
|
|
652
650
|
*/
|
|
653
|
-
unsubscribeLyrics(
|
|
654
|
-
return this.node.lyrics.unsubscribe(guildId);
|
|
651
|
+
unsubscribeLyrics() {
|
|
652
|
+
return this.node.lyrics.unsubscribe(this.guildId);
|
|
655
653
|
}
|
|
656
654
|
/**
|
|
657
655
|
* Move the player on a different Audio-Node
|
|
@@ -691,6 +691,6 @@ export class FilterManager {
|
|
|
691
691
|
}
|
|
692
692
|
/** Clears the equalizer bands. */
|
|
693
693
|
async clearEQ() {
|
|
694
|
-
return this.setEQ(Array.from({ length: 15 }, () => ({ band:
|
|
694
|
+
return this.setEQ(Array.from({ length: 15 }, (_v, i) => ({ band: i, gain: 0 })));
|
|
695
695
|
}
|
|
696
696
|
}
|
|
@@ -129,6 +129,8 @@ export class LavalinkNode {
|
|
|
129
129
|
const { response, options } = await this.rawRequest(endpoint, modify);
|
|
130
130
|
if (["DELETE", "PUT"].includes(options.method))
|
|
131
131
|
return;
|
|
132
|
+
if (response.status === 204)
|
|
133
|
+
return; // no content
|
|
132
134
|
if (response.status === 404)
|
|
133
135
|
throw new Error(`Node Request resulted into an error, request-PATH: ${options.path} | headers: ${safeStringify(response.headers)}`);
|
|
134
136
|
return parseAsText ? await response.text() : await response.json();
|
|
@@ -726,7 +728,9 @@ export class LavalinkNode {
|
|
|
726
728
|
if (!this.info.plugins.find(v => v.name === "lavasrc-plugin") &&
|
|
727
729
|
!this.info.plugins.find(v => v.name === "java-lyrics-plugin"))
|
|
728
730
|
throw new RangeError(`there is no lyrics source (via lavasrc-plugin / java-lyrics-plugin) available in the lavalink node (required for lyrics): ${this.id}`);
|
|
729
|
-
return await this.request(`/sessions/${this.sessionId}/players/${guildId}/
|
|
731
|
+
return await this.request(`/sessions/${this.sessionId}/players/${guildId}/lyrics/subscribe`, (options) => {
|
|
732
|
+
options.method = "DELETE";
|
|
733
|
+
});
|
|
730
734
|
},
|
|
731
735
|
};
|
|
732
736
|
/**
|
|
@@ -196,7 +196,6 @@ export declare class Player {
|
|
|
196
196
|
getLyrics(track: Track, skipTrackSource?: boolean): Promise<import("./Types/Node.js").LyricsResult>;
|
|
197
197
|
/**
|
|
198
198
|
* Subscribe to the lyrics event on a specific guild to active live lyrics events
|
|
199
|
-
* @param guildId The guild id to subscribe to
|
|
200
199
|
* @returns The unsubscribe function
|
|
201
200
|
* @example
|
|
202
201
|
* ```ts
|
|
@@ -206,14 +205,13 @@ export declare class Player {
|
|
|
206
205
|
subscribeLyrics(): Promise<unknown>;
|
|
207
206
|
/**
|
|
208
207
|
* Unsubscribe from the lyrics event on a specific guild to disable live lyrics events
|
|
209
|
-
* @param guildId The guild id to unsubscribe from
|
|
210
208
|
* @returns The unsubscribe function
|
|
211
209
|
* @example
|
|
212
210
|
* ```ts
|
|
213
211
|
* const lyrics = await player.unsubscribeLyrics();
|
|
214
212
|
* ```
|
|
215
213
|
*/
|
|
216
|
-
unsubscribeLyrics(
|
|
214
|
+
unsubscribeLyrics(): Promise<void>;
|
|
217
215
|
/**
|
|
218
216
|
* Move the player on a different Audio-Node
|
|
219
217
|
* @param newNode New Node / New Node Id
|
|
@@ -628,7 +628,6 @@ export class Player {
|
|
|
628
628
|
}
|
|
629
629
|
/**
|
|
630
630
|
* Subscribe to the lyrics event on a specific guild to active live lyrics events
|
|
631
|
-
* @param guildId The guild id to subscribe to
|
|
632
631
|
* @returns The unsubscribe function
|
|
633
632
|
* @example
|
|
634
633
|
* ```ts
|
|
@@ -640,15 +639,14 @@ export class Player {
|
|
|
640
639
|
}
|
|
641
640
|
/**
|
|
642
641
|
* Unsubscribe from the lyrics event on a specific guild to disable live lyrics events
|
|
643
|
-
* @param guildId The guild id to unsubscribe from
|
|
644
642
|
* @returns The unsubscribe function
|
|
645
643
|
* @example
|
|
646
644
|
* ```ts
|
|
647
645
|
* const lyrics = await player.unsubscribeLyrics();
|
|
648
646
|
* ```
|
|
649
647
|
*/
|
|
650
|
-
unsubscribeLyrics(
|
|
651
|
-
return this.node.lyrics.unsubscribe(guildId);
|
|
648
|
+
unsubscribeLyrics() {
|
|
649
|
+
return this.node.lyrics.unsubscribe(this.guildId);
|
|
652
650
|
}
|
|
653
651
|
/**
|
|
654
652
|
* Move the player on a different Audio-Node
|
|
@@ -196,7 +196,6 @@ export declare class Player {
|
|
|
196
196
|
getLyrics(track: Track, skipTrackSource?: boolean): Promise<import("./Types/Node").LyricsResult>;
|
|
197
197
|
/**
|
|
198
198
|
* Subscribe to the lyrics event on a specific guild to active live lyrics events
|
|
199
|
-
* @param guildId The guild id to subscribe to
|
|
200
199
|
* @returns The unsubscribe function
|
|
201
200
|
* @example
|
|
202
201
|
* ```ts
|
|
@@ -206,14 +205,13 @@ export declare class Player {
|
|
|
206
205
|
subscribeLyrics(): Promise<unknown>;
|
|
207
206
|
/**
|
|
208
207
|
* Unsubscribe from the lyrics event on a specific guild to disable live lyrics events
|
|
209
|
-
* @param guildId The guild id to unsubscribe from
|
|
210
208
|
* @returns The unsubscribe function
|
|
211
209
|
* @example
|
|
212
210
|
* ```ts
|
|
213
211
|
* const lyrics = await player.unsubscribeLyrics();
|
|
214
212
|
* ```
|
|
215
213
|
*/
|
|
216
|
-
unsubscribeLyrics(
|
|
214
|
+
unsubscribeLyrics(): Promise<void>;
|
|
217
215
|
/**
|
|
218
216
|
* Move the player on a different Audio-Node
|
|
219
217
|
* @param newNode New Node / New Node Id
|
package/package.json
CHANGED