lavalink-client 2.5.5 → 2.5.7
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/Node.js +5 -1
- package/dist/cjs/structures/Player.d.ts +1 -3
- package/dist/cjs/structures/Player.js +2 -4
- package/dist/cjs/structures/Queue.d.ts +5 -5
- package/dist/cjs/structures/Queue.js +5 -5
- package/dist/cjs/structures/Types/Queue.d.ts +6 -5
- package/dist/cjs/structures/Types/Utils.d.ts +3 -0
- 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/esm/structures/Queue.d.ts +5 -5
- package/dist/esm/structures/Queue.js +5 -5
- package/dist/esm/structures/Types/Queue.d.ts +6 -5
- package/dist/esm/structures/Types/Utils.d.ts +3 -0
- package/dist/types/structures/Player.d.ts +1 -3
- package/dist/types/structures/Queue.d.ts +5 -5
- package/dist/types/structures/Types/Queue.d.ts +6 -5
- package/dist/types/structures/Types/Utils.d.ts +3 -0
- package/package.json +4 -4
|
@@ -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
|
|
@@ -46,32 +46,32 @@ export declare class DefaultQueueStore implements QueueStoreManager {
|
|
|
46
46
|
* @param guildId The guild ID
|
|
47
47
|
* @returns The queue for the guild
|
|
48
48
|
*/
|
|
49
|
-
get(guildId: string):
|
|
49
|
+
get(guildId: string): StoredQueue;
|
|
50
50
|
/**
|
|
51
51
|
* Set the queue for a guild
|
|
52
52
|
* @param guildId The guild ID
|
|
53
53
|
* @param valueToStringify The queue to set
|
|
54
54
|
* @returns The queue for the guild
|
|
55
55
|
*/
|
|
56
|
-
set(guildId: string, valueToStringify: any):
|
|
56
|
+
set(guildId: string, valueToStringify: any): boolean;
|
|
57
57
|
/**
|
|
58
58
|
* Delete the queue for a guild
|
|
59
59
|
* @param guildId The guild ID
|
|
60
60
|
* @returns The queue for the guild
|
|
61
61
|
*/
|
|
62
|
-
delete(guildId: string):
|
|
62
|
+
delete(guildId: string): boolean;
|
|
63
63
|
/**
|
|
64
64
|
* Stringify the queue for a guild
|
|
65
65
|
* @param value The queue to stringify
|
|
66
66
|
* @returns The stringified queue
|
|
67
67
|
*/
|
|
68
|
-
stringify(value: StoredQueue):
|
|
68
|
+
stringify(value: StoredQueue | string): StoredQueue | string;
|
|
69
69
|
/**
|
|
70
70
|
* Parse the queue for a guild
|
|
71
71
|
* @param value The queue to parse
|
|
72
72
|
* @returns The parsed queue
|
|
73
73
|
*/
|
|
74
|
-
parse(value: StoredQueue):
|
|
74
|
+
parse(value: StoredQueue | string): Partial<StoredQueue>;
|
|
75
75
|
}
|
|
76
76
|
export declare class Queue {
|
|
77
77
|
readonly tracks: (Track | UnresolvedTrack)[];
|
|
@@ -60,7 +60,7 @@ class DefaultQueueStore {
|
|
|
60
60
|
* @param guildId The guild ID
|
|
61
61
|
* @returns The queue for the guild
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
get(guildId) {
|
|
64
64
|
return this.data.get(guildId);
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
@@ -69,7 +69,7 @@ class DefaultQueueStore {
|
|
|
69
69
|
* @param valueToStringify The queue to set
|
|
70
70
|
* @returns The queue for the guild
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
set(guildId, valueToStringify) {
|
|
73
73
|
return this.data.set(guildId, valueToStringify) ? true : false;
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
@@ -77,7 +77,7 @@ class DefaultQueueStore {
|
|
|
77
77
|
* @param guildId The guild ID
|
|
78
78
|
* @returns The queue for the guild
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
delete(guildId) {
|
|
81
81
|
return this.data.delete(guildId);
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
@@ -85,7 +85,7 @@ class DefaultQueueStore {
|
|
|
85
85
|
* @param value The queue to stringify
|
|
86
86
|
* @returns The stringified queue
|
|
87
87
|
*/
|
|
88
|
-
|
|
88
|
+
stringify(value) {
|
|
89
89
|
return value; // JSON.stringify(value);
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
@@ -93,7 +93,7 @@ class DefaultQueueStore {
|
|
|
93
93
|
* @param value The queue to parse
|
|
94
94
|
* @returns The parsed queue
|
|
95
95
|
*/
|
|
96
|
-
|
|
96
|
+
parse(value) {
|
|
97
97
|
return value; // JSON.parse(value)
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Track, UnresolvedTrack } from "./Track.js";
|
|
2
|
+
import type { Awaitable } from "./Utils.js";
|
|
2
3
|
export interface StoredQueue {
|
|
3
4
|
current: Track | null;
|
|
4
5
|
previous: Track[];
|
|
@@ -6,15 +7,15 @@ export interface StoredQueue {
|
|
|
6
7
|
}
|
|
7
8
|
export interface QueueStoreManager {
|
|
8
9
|
/** @async get a Value (MUST RETURN UNPARSED!) */
|
|
9
|
-
get: (guildId: string) =>
|
|
10
|
+
get: (guildId: string) => Awaitable<StoredQueue | string>;
|
|
10
11
|
/** @async Set a value inside a guildId (MUST BE UNPARSED) */
|
|
11
|
-
set: (guildId: string, value: StoredQueue | string) =>
|
|
12
|
+
set: (guildId: string, value: StoredQueue | string) => Awaitable<void | boolean>;
|
|
12
13
|
/** @async Delete a Database Value based of it's guildId */
|
|
13
|
-
delete: (guildId: string) =>
|
|
14
|
+
delete: (guildId: string) => Awaitable<void | boolean>;
|
|
14
15
|
/** @async Transform the value(s) inside of the QueueStoreManager (IF YOU DON'T NEED PARSING/STRINGIFY, then just return the value) */
|
|
15
|
-
stringify: (value: StoredQueue | string) =>
|
|
16
|
+
stringify: (value: StoredQueue | string) => Awaitable<StoredQueue | string>;
|
|
16
17
|
/** @async Parse the saved value back to the Queue (IF YOU DON'T NEED PARSING/STRINGIFY, then just return the value) */
|
|
17
|
-
parse: (value: StoredQueue | string) =>
|
|
18
|
+
parse: (value: StoredQueue | string) => Awaitable<Partial<StoredQueue>>;
|
|
18
19
|
}
|
|
19
20
|
export interface ManagerQueueOptions {
|
|
20
21
|
/** Maximum Amount of tracks for the queue.previous array. Set to 0 to not save previous songs. Defaults to 25 Tracks */
|
|
@@ -74,6 +74,8 @@ export interface Exception {
|
|
|
74
74
|
message: string;
|
|
75
75
|
/** Cause by lavalink */
|
|
76
76
|
cause: string;
|
|
77
|
+
/** causeStackTrace by lavalink */
|
|
78
|
+
causeStackTrace: string;
|
|
77
79
|
}
|
|
78
80
|
export interface PlayerEvent {
|
|
79
81
|
op: "event";
|
|
@@ -438,3 +440,4 @@ export type LavaSearchQuery = {
|
|
|
438
440
|
/** The Types to filter the search to */
|
|
439
441
|
types?: LavaSearchType[];
|
|
440
442
|
};
|
|
443
|
+
export type Awaitable<T> = Promise<T> | T;
|
|
@@ -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
|
|
@@ -46,32 +46,32 @@ export declare class DefaultQueueStore implements QueueStoreManager {
|
|
|
46
46
|
* @param guildId The guild ID
|
|
47
47
|
* @returns The queue for the guild
|
|
48
48
|
*/
|
|
49
|
-
get(guildId: string):
|
|
49
|
+
get(guildId: string): StoredQueue;
|
|
50
50
|
/**
|
|
51
51
|
* Set the queue for a guild
|
|
52
52
|
* @param guildId The guild ID
|
|
53
53
|
* @param valueToStringify The queue to set
|
|
54
54
|
* @returns The queue for the guild
|
|
55
55
|
*/
|
|
56
|
-
set(guildId: string, valueToStringify: any):
|
|
56
|
+
set(guildId: string, valueToStringify: any): boolean;
|
|
57
57
|
/**
|
|
58
58
|
* Delete the queue for a guild
|
|
59
59
|
* @param guildId The guild ID
|
|
60
60
|
* @returns The queue for the guild
|
|
61
61
|
*/
|
|
62
|
-
delete(guildId: string):
|
|
62
|
+
delete(guildId: string): boolean;
|
|
63
63
|
/**
|
|
64
64
|
* Stringify the queue for a guild
|
|
65
65
|
* @param value The queue to stringify
|
|
66
66
|
* @returns The stringified queue
|
|
67
67
|
*/
|
|
68
|
-
stringify(value: StoredQueue):
|
|
68
|
+
stringify(value: StoredQueue | string): StoredQueue | string;
|
|
69
69
|
/**
|
|
70
70
|
* Parse the queue for a guild
|
|
71
71
|
* @param value The queue to parse
|
|
72
72
|
* @returns The parsed queue
|
|
73
73
|
*/
|
|
74
|
-
parse(value: StoredQueue):
|
|
74
|
+
parse(value: StoredQueue | string): Partial<StoredQueue>;
|
|
75
75
|
}
|
|
76
76
|
export declare class Queue {
|
|
77
77
|
readonly tracks: (Track | UnresolvedTrack)[];
|
|
@@ -56,7 +56,7 @@ export class DefaultQueueStore {
|
|
|
56
56
|
* @param guildId The guild ID
|
|
57
57
|
* @returns The queue for the guild
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
get(guildId) {
|
|
60
60
|
return this.data.get(guildId);
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
@@ -65,7 +65,7 @@ export class DefaultQueueStore {
|
|
|
65
65
|
* @param valueToStringify The queue to set
|
|
66
66
|
* @returns The queue for the guild
|
|
67
67
|
*/
|
|
68
|
-
|
|
68
|
+
set(guildId, valueToStringify) {
|
|
69
69
|
return this.data.set(guildId, valueToStringify) ? true : false;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
@@ -73,7 +73,7 @@ export class DefaultQueueStore {
|
|
|
73
73
|
* @param guildId The guild ID
|
|
74
74
|
* @returns The queue for the guild
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
delete(guildId) {
|
|
77
77
|
return this.data.delete(guildId);
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
@@ -81,7 +81,7 @@ export class DefaultQueueStore {
|
|
|
81
81
|
* @param value The queue to stringify
|
|
82
82
|
* @returns The stringified queue
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
stringify(value) {
|
|
85
85
|
return value; // JSON.stringify(value);
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
@@ -89,7 +89,7 @@ export class DefaultQueueStore {
|
|
|
89
89
|
* @param value The queue to parse
|
|
90
90
|
* @returns The parsed queue
|
|
91
91
|
*/
|
|
92
|
-
|
|
92
|
+
parse(value) {
|
|
93
93
|
return value; // JSON.parse(value)
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Track, UnresolvedTrack } from "./Track.js";
|
|
2
|
+
import type { Awaitable } from "./Utils.js";
|
|
2
3
|
export interface StoredQueue {
|
|
3
4
|
current: Track | null;
|
|
4
5
|
previous: Track[];
|
|
@@ -6,15 +7,15 @@ export interface StoredQueue {
|
|
|
6
7
|
}
|
|
7
8
|
export interface QueueStoreManager {
|
|
8
9
|
/** @async get a Value (MUST RETURN UNPARSED!) */
|
|
9
|
-
get: (guildId: string) =>
|
|
10
|
+
get: (guildId: string) => Awaitable<StoredQueue | string>;
|
|
10
11
|
/** @async Set a value inside a guildId (MUST BE UNPARSED) */
|
|
11
|
-
set: (guildId: string, value: StoredQueue | string) =>
|
|
12
|
+
set: (guildId: string, value: StoredQueue | string) => Awaitable<void | boolean>;
|
|
12
13
|
/** @async Delete a Database Value based of it's guildId */
|
|
13
|
-
delete: (guildId: string) =>
|
|
14
|
+
delete: (guildId: string) => Awaitable<void | boolean>;
|
|
14
15
|
/** @async Transform the value(s) inside of the QueueStoreManager (IF YOU DON'T NEED PARSING/STRINGIFY, then just return the value) */
|
|
15
|
-
stringify: (value: StoredQueue | string) =>
|
|
16
|
+
stringify: (value: StoredQueue | string) => Awaitable<StoredQueue | string>;
|
|
16
17
|
/** @async Parse the saved value back to the Queue (IF YOU DON'T NEED PARSING/STRINGIFY, then just return the value) */
|
|
17
|
-
parse: (value: StoredQueue | string) =>
|
|
18
|
+
parse: (value: StoredQueue | string) => Awaitable<Partial<StoredQueue>>;
|
|
18
19
|
}
|
|
19
20
|
export interface ManagerQueueOptions {
|
|
20
21
|
/** Maximum Amount of tracks for the queue.previous array. Set to 0 to not save previous songs. Defaults to 25 Tracks */
|
|
@@ -74,6 +74,8 @@ export interface Exception {
|
|
|
74
74
|
message: string;
|
|
75
75
|
/** Cause by lavalink */
|
|
76
76
|
cause: string;
|
|
77
|
+
/** causeStackTrace by lavalink */
|
|
78
|
+
causeStackTrace: string;
|
|
77
79
|
}
|
|
78
80
|
export interface PlayerEvent {
|
|
79
81
|
op: "event";
|
|
@@ -438,3 +440,4 @@ export type LavaSearchQuery = {
|
|
|
438
440
|
/** The Types to filter the search to */
|
|
439
441
|
types?: LavaSearchType[];
|
|
440
442
|
};
|
|
443
|
+
export type Awaitable<T> = Promise<T> | T;
|
|
@@ -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
|
|
@@ -46,32 +46,32 @@ export declare class DefaultQueueStore implements QueueStoreManager {
|
|
|
46
46
|
* @param guildId The guild ID
|
|
47
47
|
* @returns The queue for the guild
|
|
48
48
|
*/
|
|
49
|
-
get(guildId: string):
|
|
49
|
+
get(guildId: string): StoredQueue;
|
|
50
50
|
/**
|
|
51
51
|
* Set the queue for a guild
|
|
52
52
|
* @param guildId The guild ID
|
|
53
53
|
* @param valueToStringify The queue to set
|
|
54
54
|
* @returns The queue for the guild
|
|
55
55
|
*/
|
|
56
|
-
set(guildId: string, valueToStringify: any):
|
|
56
|
+
set(guildId: string, valueToStringify: any): boolean;
|
|
57
57
|
/**
|
|
58
58
|
* Delete the queue for a guild
|
|
59
59
|
* @param guildId The guild ID
|
|
60
60
|
* @returns The queue for the guild
|
|
61
61
|
*/
|
|
62
|
-
delete(guildId: string):
|
|
62
|
+
delete(guildId: string): boolean;
|
|
63
63
|
/**
|
|
64
64
|
* Stringify the queue for a guild
|
|
65
65
|
* @param value The queue to stringify
|
|
66
66
|
* @returns The stringified queue
|
|
67
67
|
*/
|
|
68
|
-
stringify(value: StoredQueue):
|
|
68
|
+
stringify(value: StoredQueue | string): StoredQueue | string;
|
|
69
69
|
/**
|
|
70
70
|
* Parse the queue for a guild
|
|
71
71
|
* @param value The queue to parse
|
|
72
72
|
* @returns The parsed queue
|
|
73
73
|
*/
|
|
74
|
-
parse(value: StoredQueue):
|
|
74
|
+
parse(value: StoredQueue | string): Partial<StoredQueue>;
|
|
75
75
|
}
|
|
76
76
|
export declare class Queue {
|
|
77
77
|
readonly tracks: (Track | UnresolvedTrack)[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Track, UnresolvedTrack } from "./Track";
|
|
2
|
+
import type { Awaitable } from "./Utils";
|
|
2
3
|
export interface StoredQueue {
|
|
3
4
|
current: Track | null;
|
|
4
5
|
previous: Track[];
|
|
@@ -6,15 +7,15 @@ export interface StoredQueue {
|
|
|
6
7
|
}
|
|
7
8
|
export interface QueueStoreManager {
|
|
8
9
|
/** @async get a Value (MUST RETURN UNPARSED!) */
|
|
9
|
-
get: (guildId: string) =>
|
|
10
|
+
get: (guildId: string) => Awaitable<StoredQueue | string>;
|
|
10
11
|
/** @async Set a value inside a guildId (MUST BE UNPARSED) */
|
|
11
|
-
set: (guildId: string, value: StoredQueue | string) =>
|
|
12
|
+
set: (guildId: string, value: StoredQueue | string) => Awaitable<void | boolean>;
|
|
12
13
|
/** @async Delete a Database Value based of it's guildId */
|
|
13
|
-
delete: (guildId: string) =>
|
|
14
|
+
delete: (guildId: string) => Awaitable<void | boolean>;
|
|
14
15
|
/** @async Transform the value(s) inside of the QueueStoreManager (IF YOU DON'T NEED PARSING/STRINGIFY, then just return the value) */
|
|
15
|
-
stringify: (value: StoredQueue | string) =>
|
|
16
|
+
stringify: (value: StoredQueue | string) => Awaitable<StoredQueue | string>;
|
|
16
17
|
/** @async Parse the saved value back to the Queue (IF YOU DON'T NEED PARSING/STRINGIFY, then just return the value) */
|
|
17
|
-
parse: (value: StoredQueue | string) =>
|
|
18
|
+
parse: (value: StoredQueue | string) => Awaitable<Partial<StoredQueue>>;
|
|
18
19
|
}
|
|
19
20
|
export interface ManagerQueueOptions {
|
|
20
21
|
/** Maximum Amount of tracks for the queue.previous array. Set to 0 to not save previous songs. Defaults to 25 Tracks */
|
|
@@ -74,6 +74,8 @@ export interface Exception {
|
|
|
74
74
|
message: string;
|
|
75
75
|
/** Cause by lavalink */
|
|
76
76
|
cause: string;
|
|
77
|
+
/** causeStackTrace by lavalink */
|
|
78
|
+
causeStackTrace: string;
|
|
77
79
|
}
|
|
78
80
|
export interface PlayerEvent {
|
|
79
81
|
op: "event";
|
|
@@ -438,3 +440,4 @@ export type LavaSearchQuery = {
|
|
|
438
440
|
/** The Types to filter the search to */
|
|
439
441
|
types?: LavaSearchType[];
|
|
440
442
|
};
|
|
443
|
+
export type Awaitable<T> = Promise<T> | T;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lavalink-client",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.7",
|
|
4
4
|
"description": "Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
|
-
"types": "dist/types/index.d.
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "npm run tool:clean && npm run build:all && npm run tool:fixbuild",
|
|
10
10
|
"build:bun": "bun run tool:clean && bun run build:all:bun && bun run tool:fixbuild",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@eslint/eslintrc": "^3.3.1",
|
|
62
62
|
"@eslint/js": "^9.27.0",
|
|
63
|
-
"@types/node": "^
|
|
63
|
+
"@types/node": "^24.0.11",
|
|
64
64
|
"@types/ws": "^8.18.1",
|
|
65
65
|
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
66
66
|
"@typescript-eslint/parser": "^8.32.1",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"tslib": "^2.8.1",
|
|
73
|
-
"ws": "^8.18.
|
|
73
|
+
"ws": "^8.18.3"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
76
|
"node": ">=18.0.0",
|