magmastream 2.9.0-dev.42 → 2.9.0-dev.44
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/index.d.ts +205 -164
- package/dist/statestorage/JsonQueue.js +3 -1
- package/dist/structures/Filters.js +5 -5
- package/dist/structures/Manager.js +183 -279
- package/dist/structures/Node.js +1 -1
- package/dist/structures/Rest.js +1 -1
- package/dist/structures/Utils.js +111 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Collection } from '@discordjs/collection';
|
|
2
2
|
import { GatewayVoiceStateUpdate } from 'discord-api-types/v10';
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
|
-
import WebSocket, { WebSocket as WebSocket$1 } from 'ws';
|
|
5
4
|
import { User, ClientUser, Message, Client } from 'discord.js';
|
|
5
|
+
import WebSocket, { WebSocket as WebSocket$1 } from 'ws';
|
|
6
6
|
import { Redis } from 'ioredis';
|
|
7
7
|
import { Client as Client$1 } from 'eris';
|
|
8
8
|
import { ClusterClient, ShardClient } from 'detritus-client';
|
|
@@ -260,126 +260,6 @@ declare enum AvailableFilters {
|
|
|
260
260
|
Vibrato = "vibrato"
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
/** Handles the requests sent to the Lavalink REST API. */
|
|
264
|
-
declare class Rest {
|
|
265
|
-
/** The Node that this Rest instance is connected to. */
|
|
266
|
-
private node;
|
|
267
|
-
/** The ID of the current session. */
|
|
268
|
-
private sessionId;
|
|
269
|
-
/** The password for the Node. */
|
|
270
|
-
private readonly password;
|
|
271
|
-
/** The URL of the Node. */
|
|
272
|
-
private readonly url;
|
|
273
|
-
/** The Manager instance. */
|
|
274
|
-
manager: Manager;
|
|
275
|
-
/** Whether the node is a NodeLink. */
|
|
276
|
-
isNodeLink: boolean;
|
|
277
|
-
constructor(node: Node, manager: Manager);
|
|
278
|
-
/**
|
|
279
|
-
* Sets the session ID.
|
|
280
|
-
* This method is used to set the session ID after a resume operation is done.
|
|
281
|
-
* @param {string} sessionId The session ID to set.
|
|
282
|
-
* @returns {string} Returns the set session ID.
|
|
283
|
-
*/
|
|
284
|
-
setSessionId(sessionId: string): string;
|
|
285
|
-
/**
|
|
286
|
-
* Retrieves all the players that are currently running on the node.
|
|
287
|
-
* @returns {Promise<unknown>} Returns the result of the GET request.
|
|
288
|
-
*/
|
|
289
|
-
getAllPlayers(): Promise<unknown>;
|
|
290
|
-
/**
|
|
291
|
-
* Sends a PATCH request to update player related data.
|
|
292
|
-
* @param {playOptions} options The options to update the player with.
|
|
293
|
-
* @returns {Promise<unknown>} Returns the result of the PATCH request.
|
|
294
|
-
*/
|
|
295
|
-
updatePlayer(options: playOptions): Promise<unknown>;
|
|
296
|
-
/**
|
|
297
|
-
* Sends a DELETE request to the server to destroy the player.
|
|
298
|
-
* @param {string} guildId The guild ID of the player to destroy.
|
|
299
|
-
* @returns {Promise<unknown>} Returns the result of the DELETE request.
|
|
300
|
-
*/
|
|
301
|
-
destroyPlayer(guildId: string): Promise<unknown>;
|
|
302
|
-
/**
|
|
303
|
-
* Updates the session status for resuming.
|
|
304
|
-
* This method sends a PATCH request to update the session's resuming status and timeout.
|
|
305
|
-
*
|
|
306
|
-
* @param {boolean} resuming - Indicates whether the session should be set to resuming.
|
|
307
|
-
* @param {number} timeout - The timeout duration for the session resume.
|
|
308
|
-
* @returns {Promise<unknown>} The result of the PATCH request.
|
|
309
|
-
*/
|
|
310
|
-
updateSession(resuming: boolean, timeout: number): Promise<unknown>;
|
|
311
|
-
/**
|
|
312
|
-
* Sends a request to the specified endpoint and returns the response data.
|
|
313
|
-
* @param {string} method The HTTP method to use for the request.
|
|
314
|
-
* @param {string} endpoint The endpoint to send the request to.
|
|
315
|
-
* @param {unknown} [body] The data to send in the request body.
|
|
316
|
-
* @returns {Promise<unknown>} The response data of the request.
|
|
317
|
-
*/
|
|
318
|
-
private request;
|
|
319
|
-
/**
|
|
320
|
-
* Sends a GET request to the specified endpoint and returns the response data.
|
|
321
|
-
* @param {string} endpoint The endpoint to send the GET request to.
|
|
322
|
-
* @returns {Promise<unknown>} The response data of the GET request.
|
|
323
|
-
*/
|
|
324
|
-
get(endpoint: string): Promise<unknown>;
|
|
325
|
-
/**
|
|
326
|
-
* Sends a PATCH request to the specified endpoint and returns the response data.
|
|
327
|
-
* @param {string} endpoint The endpoint to send the PATCH request to.
|
|
328
|
-
* @param {unknown} body The data to send in the request body.
|
|
329
|
-
* @returns {Promise<unknown>} The response data of the PATCH request.
|
|
330
|
-
*/
|
|
331
|
-
patch(endpoint: string, body: unknown): Promise<unknown>;
|
|
332
|
-
/**
|
|
333
|
-
* Sends a POST request to the specified endpoint and returns the response data.
|
|
334
|
-
* @param {string} endpoint The endpoint to send the POST request to.
|
|
335
|
-
* @param {unknown} body The data to send in the request body.
|
|
336
|
-
* @returns {Promise<unknown>} The response data of the POST request.
|
|
337
|
-
*/
|
|
338
|
-
post(endpoint: string, body: unknown): Promise<unknown>;
|
|
339
|
-
/**
|
|
340
|
-
* Sends a PUT request to the specified endpoint and returns the response data.
|
|
341
|
-
* @param {string} endpoint The endpoint to send the PUT request to.
|
|
342
|
-
* @param {unknown} body The data to send in the request body.
|
|
343
|
-
* @returns {Promise<unknown>} The response data of the PUT request.
|
|
344
|
-
*/
|
|
345
|
-
put(endpoint: string, body: unknown): Promise<unknown>;
|
|
346
|
-
/**
|
|
347
|
-
* Sends a DELETE request to the specified endpoint.
|
|
348
|
-
* @param {string} endpoint - The endpoint to send the DELETE request to.
|
|
349
|
-
* @returns {Promise<unknown>} The response data of the DELETE request.
|
|
350
|
-
*/
|
|
351
|
-
delete(endpoint: string): Promise<unknown>;
|
|
352
|
-
}
|
|
353
|
-
interface playOptions {
|
|
354
|
-
guildId: string;
|
|
355
|
-
data: {
|
|
356
|
-
/** The base64 encoded track. */
|
|
357
|
-
encodedTrack?: string;
|
|
358
|
-
/** The track ID. */
|
|
359
|
-
identifier?: string;
|
|
360
|
-
/** The track time to start at. */
|
|
361
|
-
startTime?: number;
|
|
362
|
-
/** The track time to end at. */
|
|
363
|
-
endTime?: number;
|
|
364
|
-
/** The player volume level. */
|
|
365
|
-
volume?: number;
|
|
366
|
-
/** The player position in a track. */
|
|
367
|
-
position?: number;
|
|
368
|
-
/** Whether the player is paused. */
|
|
369
|
-
paused?: boolean;
|
|
370
|
-
/** The audio effects. */
|
|
371
|
-
filters?: object;
|
|
372
|
-
/** voice payload. */
|
|
373
|
-
voice?: {
|
|
374
|
-
token: string;
|
|
375
|
-
sessionId: string;
|
|
376
|
-
endpoint: string;
|
|
377
|
-
};
|
|
378
|
-
/** Whether to not replace the track if a play payload is sent. */
|
|
379
|
-
noReplace?: boolean;
|
|
380
|
-
};
|
|
381
|
-
}
|
|
382
|
-
|
|
383
263
|
/**
|
|
384
264
|
* The player's queue, the `current` property is the currently playing track, think of the rest as the up-coming tracks.
|
|
385
265
|
*/
|
|
@@ -1315,31 +1195,49 @@ interface PlaylistSearchResult {
|
|
|
1315
1195
|
/** The playlist info */
|
|
1316
1196
|
playlist: PlaylistData;
|
|
1317
1197
|
}
|
|
1198
|
+
/**
|
|
1199
|
+
* Album Search Result
|
|
1200
|
+
*/
|
|
1318
1201
|
interface AlbumSearchResult {
|
|
1319
1202
|
loadType: LoadTypes.Album;
|
|
1320
1203
|
tracks: Track[];
|
|
1321
1204
|
playlist: PlaylistData;
|
|
1322
1205
|
}
|
|
1206
|
+
/**
|
|
1207
|
+
* Artist Search Result
|
|
1208
|
+
*/
|
|
1323
1209
|
interface ArtistSearchResult {
|
|
1324
1210
|
loadType: LoadTypes.Artist;
|
|
1325
1211
|
tracks: Track[];
|
|
1326
1212
|
playlist: PlaylistData;
|
|
1327
1213
|
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Station Search Result
|
|
1216
|
+
*/
|
|
1328
1217
|
interface StationSearchResult {
|
|
1329
1218
|
loadType: LoadTypes.Station;
|
|
1330
1219
|
tracks: Track[];
|
|
1331
1220
|
playlist: PlaylistData;
|
|
1332
1221
|
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Podcast Search Result
|
|
1224
|
+
*/
|
|
1333
1225
|
interface PodcastSearchResult {
|
|
1334
1226
|
loadType: LoadTypes.Podcast;
|
|
1335
1227
|
tracks: Track[];
|
|
1336
1228
|
playlist: PlaylistData;
|
|
1337
1229
|
}
|
|
1230
|
+
/**
|
|
1231
|
+
* Show Search Result
|
|
1232
|
+
*/
|
|
1338
1233
|
interface ShowSearchResult {
|
|
1339
1234
|
loadType: LoadTypes.Show;
|
|
1340
1235
|
tracks: Track[];
|
|
1341
1236
|
playlist: PlaylistData;
|
|
1342
1237
|
}
|
|
1238
|
+
/**
|
|
1239
|
+
* Short Search Result
|
|
1240
|
+
*/
|
|
1343
1241
|
interface ShortSearchResult {
|
|
1344
1242
|
loadType: LoadTypes.Short;
|
|
1345
1243
|
tracks: [Track];
|
|
@@ -1835,6 +1733,38 @@ interface PlayOptions {
|
|
|
1835
1733
|
/** Whether to not replace the track if a play payload is sent. */
|
|
1836
1734
|
readonly noReplace?: boolean;
|
|
1837
1735
|
}
|
|
1736
|
+
/**
|
|
1737
|
+
* RestPlayOptions interface
|
|
1738
|
+
*/
|
|
1739
|
+
interface RestPlayOptions {
|
|
1740
|
+
guildId: string;
|
|
1741
|
+
data: {
|
|
1742
|
+
/** The base64 encoded track. */
|
|
1743
|
+
encodedTrack?: string;
|
|
1744
|
+
/** The track ID. */
|
|
1745
|
+
identifier?: string;
|
|
1746
|
+
/** The track time to start at. */
|
|
1747
|
+
startTime?: number;
|
|
1748
|
+
/** The track time to end at. */
|
|
1749
|
+
endTime?: number;
|
|
1750
|
+
/** The player volume level. */
|
|
1751
|
+
volume?: number;
|
|
1752
|
+
/** The player position in a track. */
|
|
1753
|
+
position?: number;
|
|
1754
|
+
/** Whether the player is paused. */
|
|
1755
|
+
paused?: boolean;
|
|
1756
|
+
/** The audio effects. */
|
|
1757
|
+
filters?: object;
|
|
1758
|
+
/** voice payload. */
|
|
1759
|
+
voice?: {
|
|
1760
|
+
token: string;
|
|
1761
|
+
sessionId: string;
|
|
1762
|
+
endpoint: string;
|
|
1763
|
+
};
|
|
1764
|
+
/** Whether to not replace the track if a play payload is sent. */
|
|
1765
|
+
noReplace?: boolean;
|
|
1766
|
+
};
|
|
1767
|
+
}
|
|
1838
1768
|
/**
|
|
1839
1769
|
* ManagerInitOptions interface
|
|
1840
1770
|
*/
|
|
@@ -1852,29 +1782,29 @@ interface EqualizerBand {
|
|
|
1852
1782
|
gain: number;
|
|
1853
1783
|
}
|
|
1854
1784
|
/** Options for adjusting the timescale of audio. */
|
|
1855
|
-
interface
|
|
1785
|
+
interface TimescaleOptions {
|
|
1856
1786
|
speed?: number;
|
|
1857
1787
|
pitch?: number;
|
|
1858
1788
|
rate?: number;
|
|
1859
1789
|
}
|
|
1860
1790
|
/** Options for applying vibrato effect to audio. */
|
|
1861
|
-
interface
|
|
1791
|
+
interface VibratoOptions {
|
|
1862
1792
|
frequency: number;
|
|
1863
1793
|
depth: number;
|
|
1864
1794
|
}
|
|
1865
1795
|
/** Options for applying rotation effect to audio. */
|
|
1866
|
-
interface
|
|
1796
|
+
interface RotationOptions {
|
|
1867
1797
|
rotationHz: number;
|
|
1868
1798
|
}
|
|
1869
1799
|
/** Options for applying karaoke effect to audio. */
|
|
1870
|
-
interface
|
|
1800
|
+
interface KaraokeOptions {
|
|
1871
1801
|
level?: number;
|
|
1872
1802
|
monoLevel?: number;
|
|
1873
1803
|
filterBand?: number;
|
|
1874
1804
|
filterWidth?: number;
|
|
1875
1805
|
}
|
|
1876
1806
|
/** Options for applying distortion effect to audio. */
|
|
1877
|
-
interface
|
|
1807
|
+
interface DistortionOptions {
|
|
1878
1808
|
sinOffset?: number;
|
|
1879
1809
|
sinScale?: number;
|
|
1880
1810
|
cosOffset?: number;
|
|
@@ -1885,7 +1815,7 @@ interface distortionOptions {
|
|
|
1885
1815
|
scale?: number;
|
|
1886
1816
|
}
|
|
1887
1817
|
/** Options for applying reverb effect to audio. */
|
|
1888
|
-
interface
|
|
1818
|
+
interface ReverbOptions {
|
|
1889
1819
|
wet?: number;
|
|
1890
1820
|
dry?: number;
|
|
1891
1821
|
roomSize?: number;
|
|
@@ -1984,6 +1914,97 @@ type LyricsEvent = LyricsFoundEvent | LyricsNotFoundEvent | LyricsLineEvent;
|
|
|
1984
1914
|
*/
|
|
1985
1915
|
type LyricsEventType = "LyricsFoundEvent" | "LyricsNotFoundEvent" | "LyricsLineEvent";
|
|
1986
1916
|
|
|
1917
|
+
/** Handles the requests sent to the Lavalink REST API. */
|
|
1918
|
+
declare class Rest {
|
|
1919
|
+
/** The Node that this Rest instance is connected to. */
|
|
1920
|
+
private node;
|
|
1921
|
+
/** The ID of the current session. */
|
|
1922
|
+
private sessionId;
|
|
1923
|
+
/** The password for the Node. */
|
|
1924
|
+
private readonly password;
|
|
1925
|
+
/** The URL of the Node. */
|
|
1926
|
+
private readonly url;
|
|
1927
|
+
/** The Manager instance. */
|
|
1928
|
+
manager: Manager;
|
|
1929
|
+
/** Whether the node is a NodeLink. */
|
|
1930
|
+
isNodeLink: boolean;
|
|
1931
|
+
constructor(node: Node, manager: Manager);
|
|
1932
|
+
/**
|
|
1933
|
+
* Sets the session ID.
|
|
1934
|
+
* This method is used to set the session ID after a resume operation is done.
|
|
1935
|
+
* @param {string} sessionId The session ID to set.
|
|
1936
|
+
* @returns {string} Returns the set session ID.
|
|
1937
|
+
*/
|
|
1938
|
+
setSessionId(sessionId: string): string;
|
|
1939
|
+
/**
|
|
1940
|
+
* Retrieves all the players that are currently running on the node.
|
|
1941
|
+
* @returns {Promise<unknown>} Returns the result of the GET request.
|
|
1942
|
+
*/
|
|
1943
|
+
getAllPlayers(): Promise<unknown>;
|
|
1944
|
+
/**
|
|
1945
|
+
* Sends a PATCH request to update player related data.
|
|
1946
|
+
* @param {RestPlayOptions} options The options to update the player with.
|
|
1947
|
+
* @returns {Promise<unknown>} Returns the result of the PATCH request.
|
|
1948
|
+
*/
|
|
1949
|
+
updatePlayer(options: RestPlayOptions): Promise<unknown>;
|
|
1950
|
+
/**
|
|
1951
|
+
* Sends a DELETE request to the server to destroy the player.
|
|
1952
|
+
* @param {string} guildId The guild ID of the player to destroy.
|
|
1953
|
+
* @returns {Promise<unknown>} Returns the result of the DELETE request.
|
|
1954
|
+
*/
|
|
1955
|
+
destroyPlayer(guildId: string): Promise<unknown>;
|
|
1956
|
+
/**
|
|
1957
|
+
* Updates the session status for resuming.
|
|
1958
|
+
* This method sends a PATCH request to update the session's resuming status and timeout.
|
|
1959
|
+
*
|
|
1960
|
+
* @param {boolean} resuming - Indicates whether the session should be set to resuming.
|
|
1961
|
+
* @param {number} timeout - The timeout duration for the session resume.
|
|
1962
|
+
* @returns {Promise<unknown>} The result of the PATCH request.
|
|
1963
|
+
*/
|
|
1964
|
+
updateSession(resuming: boolean, timeout: number): Promise<unknown>;
|
|
1965
|
+
/**
|
|
1966
|
+
* Sends a request to the specified endpoint and returns the response data.
|
|
1967
|
+
* @param {string} method The HTTP method to use for the request.
|
|
1968
|
+
* @param {string} endpoint The endpoint to send the request to.
|
|
1969
|
+
* @param {unknown} [body] The data to send in the request body.
|
|
1970
|
+
* @returns {Promise<unknown>} The response data of the request.
|
|
1971
|
+
*/
|
|
1972
|
+
private request;
|
|
1973
|
+
/**
|
|
1974
|
+
* Sends a GET request to the specified endpoint and returns the response data.
|
|
1975
|
+
* @param {string} endpoint The endpoint to send the GET request to.
|
|
1976
|
+
* @returns {Promise<unknown>} The response data of the GET request.
|
|
1977
|
+
*/
|
|
1978
|
+
get(endpoint: string): Promise<unknown>;
|
|
1979
|
+
/**
|
|
1980
|
+
* Sends a PATCH request to the specified endpoint and returns the response data.
|
|
1981
|
+
* @param {string} endpoint The endpoint to send the PATCH request to.
|
|
1982
|
+
* @param {unknown} body The data to send in the request body.
|
|
1983
|
+
* @returns {Promise<unknown>} The response data of the PATCH request.
|
|
1984
|
+
*/
|
|
1985
|
+
patch(endpoint: string, body: unknown): Promise<unknown>;
|
|
1986
|
+
/**
|
|
1987
|
+
* Sends a POST request to the specified endpoint and returns the response data.
|
|
1988
|
+
* @param {string} endpoint The endpoint to send the POST request to.
|
|
1989
|
+
* @param {unknown} body The data to send in the request body.
|
|
1990
|
+
* @returns {Promise<unknown>} The response data of the POST request.
|
|
1991
|
+
*/
|
|
1992
|
+
post(endpoint: string, body: unknown): Promise<unknown>;
|
|
1993
|
+
/**
|
|
1994
|
+
* Sends a PUT request to the specified endpoint and returns the response data.
|
|
1995
|
+
* @param {string} endpoint The endpoint to send the PUT request to.
|
|
1996
|
+
* @param {unknown} body The data to send in the request body.
|
|
1997
|
+
* @returns {Promise<unknown>} The response data of the PUT request.
|
|
1998
|
+
*/
|
|
1999
|
+
put(endpoint: string, body: unknown): Promise<unknown>;
|
|
2000
|
+
/**
|
|
2001
|
+
* Sends a DELETE request to the specified endpoint.
|
|
2002
|
+
* @param {string} endpoint - The endpoint to send the DELETE request to.
|
|
2003
|
+
* @returns {Promise<unknown>} The response data of the DELETE request.
|
|
2004
|
+
*/
|
|
2005
|
+
delete(endpoint: string): Promise<unknown>;
|
|
2006
|
+
}
|
|
2007
|
+
|
|
1987
2008
|
declare class Node {
|
|
1988
2009
|
manager: Manager;
|
|
1989
2010
|
options: NodeOptions;
|
|
@@ -2420,13 +2441,6 @@ declare class Manager extends EventEmitter {
|
|
|
2420
2441
|
* @returns The player if it exists, undefined otherwise.
|
|
2421
2442
|
*/
|
|
2422
2443
|
getPlayer(guildId: string): Player | undefined;
|
|
2423
|
-
/**
|
|
2424
|
-
* @deprecated - Will be removed with v2.10.0 use {@link getPlayer} instead
|
|
2425
|
-
* Returns a player or undefined if it does not exist.
|
|
2426
|
-
* @param guildId The guild ID of the player to retrieve.
|
|
2427
|
-
* @returns The player if it exists, undefined otherwise.
|
|
2428
|
-
*/
|
|
2429
|
-
get(guildId: string): Promise<Player | undefined>;
|
|
2430
2444
|
/**
|
|
2431
2445
|
* Creates a player or returns one if it already exists.
|
|
2432
2446
|
* @param options The options to create the player with.
|
|
@@ -2563,18 +2577,6 @@ declare class Manager extends EventEmitter {
|
|
|
2563
2577
|
* @emits {playerDisconnect} - Emits a player disconnect event if the channel ID is null.
|
|
2564
2578
|
*/
|
|
2565
2579
|
private handleVoiceStateUpdate;
|
|
2566
|
-
/**
|
|
2567
|
-
* Gets each player's JSON file
|
|
2568
|
-
* @param {string} guildId - The guild ID
|
|
2569
|
-
* @returns {string} The path to the player's JSON file
|
|
2570
|
-
*/
|
|
2571
|
-
private getPlayerFilePath;
|
|
2572
|
-
/**
|
|
2573
|
-
* Serializes a Player instance to avoid circular references.
|
|
2574
|
-
* @param player The Player instance to serialize
|
|
2575
|
-
* @returns The serialized Player instance
|
|
2576
|
-
*/
|
|
2577
|
-
serializePlayer(player: Player): Promise<Record<string, unknown>>;
|
|
2578
2580
|
/**
|
|
2579
2581
|
* Cleans up inactive players by removing their state files from the file system.
|
|
2580
2582
|
* This is done to prevent stale state files from accumulating on the file system.
|
|
@@ -2961,14 +2963,14 @@ declare class Player {
|
|
|
2961
2963
|
}
|
|
2962
2964
|
|
|
2963
2965
|
declare class Filters {
|
|
2964
|
-
distortion:
|
|
2966
|
+
distortion: DistortionOptions | null;
|
|
2965
2967
|
equalizer: Band[];
|
|
2966
|
-
karaoke:
|
|
2968
|
+
karaoke: KaraokeOptions | null;
|
|
2967
2969
|
player: Player;
|
|
2968
|
-
rotation:
|
|
2969
|
-
timescale:
|
|
2970
|
-
vibrato:
|
|
2971
|
-
reverb:
|
|
2970
|
+
rotation: RotationOptions | null;
|
|
2971
|
+
timescale: TimescaleOptions | null;
|
|
2972
|
+
vibrato: VibratoOptions | null;
|
|
2973
|
+
reverb: ReverbOptions | null;
|
|
2972
2974
|
volume: number;
|
|
2973
2975
|
bassBoostlevel: number;
|
|
2974
2976
|
filtersStatus: Record<AvailableFilters, boolean>;
|
|
@@ -3043,19 +3045,19 @@ declare class Filters {
|
|
|
3043
3045
|
* original vocals removed. Note that not all songs can be successfully made into
|
|
3044
3046
|
* karaoke tracks, and some tracks may not sound as good.
|
|
3045
3047
|
*
|
|
3046
|
-
* @param {
|
|
3048
|
+
* @param {KaraokeOptions} [karaoke] - The karaoke settings to apply (level, monoLevel, filterBand, filterWidth).
|
|
3047
3049
|
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3048
3050
|
*/
|
|
3049
|
-
setKaraoke(karaoke?:
|
|
3051
|
+
setKaraoke(karaoke?: KaraokeOptions): Promise<this>;
|
|
3050
3052
|
/**
|
|
3051
3053
|
* Sets the own timescale options to the audio.
|
|
3052
3054
|
*
|
|
3053
3055
|
* This method adjusts the speed and pitch of the audio, allowing you to control the playback speed.
|
|
3054
3056
|
*
|
|
3055
|
-
* @param {
|
|
3057
|
+
* @param {TimescaleOptions} [timescale] - The timescale settings to apply (speed and pitch).
|
|
3056
3058
|
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3057
3059
|
*/
|
|
3058
|
-
setTimescale(timescale?:
|
|
3060
|
+
setTimescale(timescale?: TimescaleOptions): Promise<this>;
|
|
3059
3061
|
/**
|
|
3060
3062
|
* Sets the own vibrato options to the audio.
|
|
3061
3063
|
*
|
|
@@ -3063,10 +3065,10 @@ declare class Filters {
|
|
|
3063
3065
|
* pulsing quality to the sound. The effect is created by rapidly varying the
|
|
3064
3066
|
* pitch of the audio.
|
|
3065
3067
|
*
|
|
3066
|
-
* @param {
|
|
3068
|
+
* @param {VibratoOptions} [vibrato] - The vibrato settings to apply (frequency, depth).
|
|
3067
3069
|
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3068
3070
|
*/
|
|
3069
|
-
setVibrato(vibrato?:
|
|
3071
|
+
setVibrato(vibrato?: VibratoOptions): Promise<this>;
|
|
3070
3072
|
/**
|
|
3071
3073
|
* Sets the own rotation options effect to the audio.
|
|
3072
3074
|
*
|
|
@@ -3074,10 +3076,10 @@ declare class Filters {
|
|
|
3074
3076
|
* moving around the listener's head. This effect can create a dynamic and immersive
|
|
3075
3077
|
* audio experience by altering the directionality of the sound.
|
|
3076
3078
|
*
|
|
3077
|
-
* @param {
|
|
3079
|
+
* @param {RotationOptions} [rotation] - The rotation settings to apply (rotationHz).
|
|
3078
3080
|
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3079
3081
|
*/
|
|
3080
|
-
setRotation(rotation?:
|
|
3082
|
+
setRotation(rotation?: RotationOptions): Promise<this>;
|
|
3081
3083
|
/**
|
|
3082
3084
|
* Sets the own distortion options effect to the audio.
|
|
3083
3085
|
*
|
|
@@ -3085,10 +3087,10 @@ declare class Filters {
|
|
|
3085
3087
|
* more intense quality to the sound. The effect is created by altering the
|
|
3086
3088
|
* audio signal to create a more jagged, irregular waveform.
|
|
3087
3089
|
*
|
|
3088
|
-
* @param {
|
|
3090
|
+
* @param {DistortionOptions} [distortion] - The distortion settings to apply (sinOffset, sinScale, cosOffset, cosScale, tanOffset, tanScale, offset, scale).
|
|
3089
3091
|
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3090
3092
|
*/
|
|
3091
|
-
setDistortion(distortion?:
|
|
3093
|
+
setDistortion(distortion?: DistortionOptions): Promise<this>;
|
|
3092
3094
|
/**
|
|
3093
3095
|
* Sets the bass boost level on the audio.
|
|
3094
3096
|
*
|
|
@@ -3392,6 +3394,45 @@ declare abstract class AutoPlayUtils {
|
|
|
3392
3394
|
private static isTrackDataArray;
|
|
3393
3395
|
static buildTracksFromResponse<T>(recommendedResult: LavalinkResponse, requester?: T): Track[];
|
|
3394
3396
|
}
|
|
3397
|
+
declare abstract class PlayerUtils {
|
|
3398
|
+
private static manager;
|
|
3399
|
+
/**
|
|
3400
|
+
* Initializes the PlayerUtils class with the given manager.
|
|
3401
|
+
* @param manager The manager instance to use.
|
|
3402
|
+
* @hidden
|
|
3403
|
+
*/
|
|
3404
|
+
static init(manager: Manager): void;
|
|
3405
|
+
/**
|
|
3406
|
+
* Serializes a Player instance to avoid circular references.
|
|
3407
|
+
* @param player The Player instance to serialize
|
|
3408
|
+
* @returns The serialized Player instance
|
|
3409
|
+
*/
|
|
3410
|
+
static serializePlayer(player: Player): Promise<Record<string, unknown>>;
|
|
3411
|
+
/**
|
|
3412
|
+
* Gets the base directory for player data.
|
|
3413
|
+
*/
|
|
3414
|
+
static getPlayersBaseDir(): string;
|
|
3415
|
+
/**
|
|
3416
|
+
* Gets the path to the player's directory.
|
|
3417
|
+
*/
|
|
3418
|
+
static getGuildDir(guildId: string): string;
|
|
3419
|
+
/**
|
|
3420
|
+
* Gets the path to the player's state file.
|
|
3421
|
+
*/
|
|
3422
|
+
static getPlayerStatePath(guildId: string): string;
|
|
3423
|
+
/**
|
|
3424
|
+
* Gets the path to the player's current track file.
|
|
3425
|
+
*/
|
|
3426
|
+
static getPlayerCurrentPath(guildId: string): string;
|
|
3427
|
+
/**
|
|
3428
|
+
* Gets the path to the player's queue file.
|
|
3429
|
+
*/
|
|
3430
|
+
static getPlayerQueuePath(guildId: string): string;
|
|
3431
|
+
/**
|
|
3432
|
+
* Gets the path to the player's previous tracks file.
|
|
3433
|
+
*/
|
|
3434
|
+
static getPlayerPreviousPath(guildId: string): string;
|
|
3435
|
+
}
|
|
3395
3436
|
/** Gets or extends structures to extend the built in, or already extended, classes to add more functionality. */
|
|
3396
3437
|
declare abstract class Structure {
|
|
3397
3438
|
/**
|
|
@@ -3474,5 +3515,5 @@ declare class SeyfertManager extends Manager {
|
|
|
3474
3515
|
protected send(packet: GatewayVoiceStateUpdate): void;
|
|
3475
3516
|
}
|
|
3476
3517
|
|
|
3477
|
-
export { AutoPlayPlatform, AutoPlayUtils, AvailableFilters, DetritusManager, DiscordJSManager, ErisManager, Filters, JsonQueue, LoadTypes, Manager, ManagerEventTypes, MemoryQueue, Node, OceanicManager, Player, PlayerStateEventTypes, Plugin, RedisQueue, Rest, SearchPlatform, SeverityTypes, SeyfertManager, SponsorBlockSegment, StateStorageType, StateTypes, Structure, TrackEndReasonTypes, TrackPartial, TrackSourceTypes, TrackUtils, UseNodeOptions };
|
|
3478
|
-
export type { AlbumSearchResult, ArtistSearchResult, CPUStats, DiscordPacket, EndSpeakingEventVoiceReceiver, EndSpeakingEventVoiceReceiverData, EqualizerBand, ErrorOrEmptySearchResult, Exception, Extendable, FrameStats, IQueue, JsonConfig, LavaPlayer, LavalinkInfo, LavalinkResponse, LoadType, Lyrics, LyricsEvent, LyricsEventType, LyricsFoundEvent, LyricsLine, LyricsLineEvent, LyricsNotFoundEvent, ManagerEvents, ManagerInitOptions, ManagerOptions, MemoryStats, NodeLinkGetLyrics, NodeLinkGetLyricsEmpty, NodeLinkGetLyricsError, NodeLinkGetLyricsMultiple, NodeLinkGetLyricsSingle, NodeMessage, NodeOptions, NodeStats, PlayOptions, PlayerEvent, PlayerEventType, PlayerEvents, PlayerOptions, PlayerStateUpdateEvent, PlayerUpdateVoiceState, PlaylistData, PlaylistInfoData, PlaylistRawData, PlaylistSearchResult, PodcastSearchResult, RedisConfig, SearchQuery, SearchResult, SearchSearchResult, Severity, ShortSearchResult, ShowSearchResult, Sizes, SponsorBlockChapterStarted, SponsorBlockChaptersLoaded, SponsorBlockSegmentEventType, SponsorBlockSegmentEvents, SponsorBlockSegmentSkipped, SponsorBlockSegmentsLoaded, StartSpeakingEventVoiceReceiver, StartSpeakingEventVoiceReceiverData, StateStorageOptions, StationSearchResult, Track, TrackData, TrackDataInfo, TrackEndEvent, TrackEndReason, TrackExceptionEvent, TrackPluginInfo, TrackSearchResult, TrackSourceName, TrackStartEvent, TrackStuckEvent, UseNodeOption, VoicePacket, VoiceReceiverEvent, VoiceServer, VoiceServerUpdate, VoiceState, WebSocketClosedEvent
|
|
3518
|
+
export { AutoPlayPlatform, AutoPlayUtils, AvailableFilters, DetritusManager, DiscordJSManager, ErisManager, Filters, JsonQueue, LoadTypes, Manager, ManagerEventTypes, MemoryQueue, Node, OceanicManager, Player, PlayerStateEventTypes, PlayerUtils, Plugin, RedisQueue, Rest, SearchPlatform, SeverityTypes, SeyfertManager, SponsorBlockSegment, StateStorageType, StateTypes, Structure, TrackEndReasonTypes, TrackPartial, TrackSourceTypes, TrackUtils, UseNodeOptions };
|
|
3519
|
+
export type { AlbumSearchResult, ArtistSearchResult, CPUStats, DiscordPacket, DistortionOptions, EndSpeakingEventVoiceReceiver, EndSpeakingEventVoiceReceiverData, EqualizerBand, ErrorOrEmptySearchResult, Exception, Extendable, FrameStats, IQueue, JsonConfig, KaraokeOptions, LavaPlayer, LavalinkInfo, LavalinkResponse, LoadType, Lyrics, LyricsEvent, LyricsEventType, LyricsFoundEvent, LyricsLine, LyricsLineEvent, LyricsNotFoundEvent, ManagerEvents, ManagerInitOptions, ManagerOptions, MemoryStats, NodeLinkGetLyrics, NodeLinkGetLyricsEmpty, NodeLinkGetLyricsError, NodeLinkGetLyricsMultiple, NodeLinkGetLyricsSingle, NodeMessage, NodeOptions, NodeStats, PlayOptions, PlayerEvent, PlayerEventType, PlayerEvents, PlayerOptions, PlayerStateUpdateEvent, PlayerUpdateVoiceState, PlaylistData, PlaylistInfoData, PlaylistRawData, PlaylistSearchResult, PodcastSearchResult, RedisConfig, RestPlayOptions, ReverbOptions, RotationOptions, SearchQuery, SearchResult, SearchSearchResult, Severity, ShortSearchResult, ShowSearchResult, Sizes, SponsorBlockChapterStarted, SponsorBlockChaptersLoaded, SponsorBlockSegmentEventType, SponsorBlockSegmentEvents, SponsorBlockSegmentSkipped, SponsorBlockSegmentsLoaded, StartSpeakingEventVoiceReceiver, StartSpeakingEventVoiceReceiverData, StateStorageOptions, StationSearchResult, TimescaleOptions, Track, TrackData, TrackDataInfo, TrackEndEvent, TrackEndReason, TrackExceptionEvent, TrackPluginInfo, TrackSearchResult, TrackSourceName, TrackStartEvent, TrackStuckEvent, UseNodeOption, VibratoOptions, VoicePacket, VoiceReceiverEvent, VoiceServer, VoiceServerUpdate, VoiceState, WebSocketClosedEvent };
|
|
@@ -19,7 +19,7 @@ class JsonQueue {
|
|
|
19
19
|
constructor(guildId, manager) {
|
|
20
20
|
this.guildId = guildId;
|
|
21
21
|
this.manager = manager;
|
|
22
|
-
const base = manager.options.stateStorage?.jsonConfig?.path ?? path_1.default.join(process.cwd(), "magmastream", "
|
|
22
|
+
const base = manager.options.stateStorage?.jsonConfig?.path ?? path_1.default.join(process.cwd(), "magmastream", "sessionData", "players");
|
|
23
23
|
this.basePath = path_1.default.join(base, this.guildId);
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -57,6 +57,7 @@ class JsonQueue {
|
|
|
57
57
|
* @param queue The queue.
|
|
58
58
|
*/
|
|
59
59
|
async setQueue(queue) {
|
|
60
|
+
await this.deleteFile(this.queuePath);
|
|
60
61
|
await this.writeJSON(this.queuePath, queue);
|
|
61
62
|
}
|
|
62
63
|
/**
|
|
@@ -132,6 +133,7 @@ class JsonQueue {
|
|
|
132
133
|
const tracks = Array.isArray(track) ? track : [track];
|
|
133
134
|
if (!tracks.length)
|
|
134
135
|
return;
|
|
136
|
+
await this.deleteFile(this.previousPath);
|
|
135
137
|
await this.writeJSON(this.previousPath, tracks);
|
|
136
138
|
}
|
|
137
139
|
/**
|
|
@@ -145,7 +145,7 @@ class Filters {
|
|
|
145
145
|
* original vocals removed. Note that not all songs can be successfully made into
|
|
146
146
|
* karaoke tracks, and some tracks may not sound as good.
|
|
147
147
|
*
|
|
148
|
-
* @param {
|
|
148
|
+
* @param {KaraokeOptions} [karaoke] - The karaoke settings to apply (level, monoLevel, filterBand, filterWidth).
|
|
149
149
|
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
150
150
|
*/
|
|
151
151
|
async setKaraoke(karaoke) {
|
|
@@ -159,7 +159,7 @@ class Filters {
|
|
|
159
159
|
*
|
|
160
160
|
* This method adjusts the speed and pitch of the audio, allowing you to control the playback speed.
|
|
161
161
|
*
|
|
162
|
-
* @param {
|
|
162
|
+
* @param {TimescaleOptions} [timescale] - The timescale settings to apply (speed and pitch).
|
|
163
163
|
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
164
164
|
*/
|
|
165
165
|
async setTimescale(timescale) {
|
|
@@ -175,7 +175,7 @@ class Filters {
|
|
|
175
175
|
* pulsing quality to the sound. The effect is created by rapidly varying the
|
|
176
176
|
* pitch of the audio.
|
|
177
177
|
*
|
|
178
|
-
* @param {
|
|
178
|
+
* @param {VibratoOptions} [vibrato] - The vibrato settings to apply (frequency, depth).
|
|
179
179
|
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
180
180
|
*/
|
|
181
181
|
async setVibrato(vibrato) {
|
|
@@ -191,7 +191,7 @@ class Filters {
|
|
|
191
191
|
* moving around the listener's head. This effect can create a dynamic and immersive
|
|
192
192
|
* audio experience by altering the directionality of the sound.
|
|
193
193
|
*
|
|
194
|
-
* @param {
|
|
194
|
+
* @param {RotationOptions} [rotation] - The rotation settings to apply (rotationHz).
|
|
195
195
|
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
196
196
|
*/
|
|
197
197
|
async setRotation(rotation) {
|
|
@@ -207,7 +207,7 @@ class Filters {
|
|
|
207
207
|
* more intense quality to the sound. The effect is created by altering the
|
|
208
208
|
* audio signal to create a more jagged, irregular waveform.
|
|
209
209
|
*
|
|
210
|
-
* @param {
|
|
210
|
+
* @param {DistortionOptions} [distortion] - The distortion settings to apply (sinOffset, sinScale, cosOffset, cosScale, tanOffset, tanScale, offset, scale).
|
|
211
211
|
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
212
212
|
*/
|
|
213
213
|
async setDistortion(distortion) {
|