lavalink-client 2.5.6 → 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/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/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/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
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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",
|