magmastream 2.9.3-dev.25 → 2.9.3-dev.26
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/config/blockedWords.d.ts +1 -0
- package/dist/index.d.ts +19 -3781
- package/dist/statestorage/JsonQueue.d.ts +173 -0
- package/dist/statestorage/JsonQueue.js +5 -2
- package/dist/statestorage/MemoryQueue.d.ts +154 -0
- package/dist/statestorage/MemoryQueue.js +6 -2
- package/dist/statestorage/RedisQueue.d.ts +178 -0
- package/dist/structures/Enums.d.ts +310 -0
- package/dist/structures/Filters.d.ts +352 -0
- package/dist/structures/MagmastreamError.d.ts +14 -0
- package/dist/structures/Manager.d.ts +259 -0
- package/dist/structures/Manager.js +200 -368
- package/dist/structures/Node.d.ts +390 -0
- package/dist/structures/Player.d.ts +347 -0
- package/dist/structures/Plugin.d.ts +23 -0
- package/dist/structures/Rest.d.ts +93 -0
- package/dist/structures/Types.d.ts +1315 -0
- package/dist/structures/Utils.d.ts +169 -0
- package/dist/structures/Utils.js +19 -1
- package/dist/utils/filtersEqualizers.d.ts +16 -0
- package/dist/utils/managerCheck.d.ts +7 -0
- package/dist/utils/nodeCheck.d.ts +7 -0
- package/dist/utils/playerCheck.d.ts +7 -0
- package/dist/wrappers/discord.js.d.ts +15 -0
- package/dist/wrappers/discordeno.d.ts +19 -0
- package/dist/wrappers/eris.d.ts +15 -0
- package/dist/wrappers/oceanic.d.ts +15 -0
- package/dist/wrappers/seyfert.d.ts +37 -0
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3781 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* State Storage Enum
|
|
22
|
-
*/
|
|
23
|
-
declare enum StateStorageType {
|
|
24
|
-
Memory = "memory",
|
|
25
|
-
Redis = "redis",
|
|
26
|
-
JSON = "json"
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* AutoPlay Platform Enum
|
|
30
|
-
*/
|
|
31
|
-
declare enum AutoPlayPlatform {
|
|
32
|
-
Spotify = "spotify",
|
|
33
|
-
Deezer = "deezer",
|
|
34
|
-
SoundCloud = "soundcloud",
|
|
35
|
-
Tidal = "tidal",
|
|
36
|
-
VKMusic = "vkmusic",
|
|
37
|
-
Qobuz = "qobuz",
|
|
38
|
-
YouTube = "youtube"
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* State Types Enum
|
|
42
|
-
*/
|
|
43
|
-
declare enum StateTypes {
|
|
44
|
-
Connected = "CONNECTED",
|
|
45
|
-
Connecting = "CONNECTING",
|
|
46
|
-
Disconnected = "DISCONNECTED",
|
|
47
|
-
Disconnecting = "DISCONNECTING",
|
|
48
|
-
Destroying = "DESTROYING"
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Load Types Enum
|
|
52
|
-
*/
|
|
53
|
-
declare enum LoadTypes {
|
|
54
|
-
Track = "track",
|
|
55
|
-
Playlist = "playlist",
|
|
56
|
-
Search = "search",
|
|
57
|
-
Empty = "empty",
|
|
58
|
-
Error = "error",
|
|
59
|
-
/** Nodelink */
|
|
60
|
-
Album = "album",
|
|
61
|
-
/** Nodelink */
|
|
62
|
-
Artist = "artist",
|
|
63
|
-
/** Nodelink */
|
|
64
|
-
Station = "station",
|
|
65
|
-
/** Nodelink */
|
|
66
|
-
Podcast = "podcast",
|
|
67
|
-
/** Nodelink */
|
|
68
|
-
Show = "show",
|
|
69
|
-
/** Nodelink */
|
|
70
|
-
Short = "short"
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Search Platform Enum
|
|
74
|
-
*/
|
|
75
|
-
declare enum SearchPlatform {
|
|
76
|
-
AppleMusic = "amsearch",
|
|
77
|
-
Audius = "audsearch",
|
|
78
|
-
Bandcamp = "bcsearch",
|
|
79
|
-
Deezer = "dzsearch",
|
|
80
|
-
Jiosaavn = "jssearch",
|
|
81
|
-
Qobuz = "qbsearch",
|
|
82
|
-
SoundCloud = "scsearch",
|
|
83
|
-
Spotify = "spsearch",
|
|
84
|
-
Tidal = "tdsearch",
|
|
85
|
-
TTS = "speak",
|
|
86
|
-
VKMusic = "vksearch",
|
|
87
|
-
YouTube = "ytsearch",
|
|
88
|
-
YouTubeMusic = "ytmsearch"
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Player State Event Types Enum
|
|
92
|
-
*/
|
|
93
|
-
declare enum PlayerStateEventTypes {
|
|
94
|
-
AutoPlayChange = "playerAutoplay",
|
|
95
|
-
ConnectionChange = "playerConnection",
|
|
96
|
-
RepeatChange = "playerRepeat",
|
|
97
|
-
PauseChange = "playerPause",
|
|
98
|
-
QueueChange = "queueChange",
|
|
99
|
-
TrackChange = "trackChange",
|
|
100
|
-
VolumeChange = "volumeChange",
|
|
101
|
-
ChannelChange = "channelChange",
|
|
102
|
-
PlayerCreate = "playerCreate",
|
|
103
|
-
PlayerDestroy = "playerDestroy",
|
|
104
|
-
FilterChange = "filterChange"
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Track Source Types Enum
|
|
108
|
-
*/
|
|
109
|
-
declare enum TrackSourceTypes {
|
|
110
|
-
AppleMusic = "AppleMusic",
|
|
111
|
-
Audius = "Audius",
|
|
112
|
-
Bandcamp = "Bandcamp",
|
|
113
|
-
Deezer = "Deezer",
|
|
114
|
-
Jiosaavn = "Jiosaavn",
|
|
115
|
-
Qobuz = "Qobuz",
|
|
116
|
-
SoundCloud = "SoundCloud",
|
|
117
|
-
Spotify = "Spotify",
|
|
118
|
-
Tidal = "Tidal",
|
|
119
|
-
VKMusic = "VKMusic",
|
|
120
|
-
YouTube = "YouTube",
|
|
121
|
-
Pornhub = "Pornub",
|
|
122
|
-
TikTok = "TikTok",
|
|
123
|
-
Flowertts = "Flowertts",
|
|
124
|
-
Ocremix = "Ocremix",
|
|
125
|
-
Mixcloud = "Mixcloud",
|
|
126
|
-
Soundgasm = "Soundgasm",
|
|
127
|
-
Reddit = "Reddit",
|
|
128
|
-
Clypit = "Clypit",
|
|
129
|
-
Http = "Http",
|
|
130
|
-
Tts = "Tts"
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Use Node Options Enum
|
|
134
|
-
*/
|
|
135
|
-
declare enum UseNodeOptions {
|
|
136
|
-
LeastLoad = "leastLoad",
|
|
137
|
-
LeastPlayers = "leastPlayers"
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Track Partial Enum
|
|
141
|
-
*/
|
|
142
|
-
declare enum TrackPartial {
|
|
143
|
-
/** The base64 encoded string of the track */
|
|
144
|
-
Track = "track",
|
|
145
|
-
/** The title of the track */
|
|
146
|
-
Title = "title",
|
|
147
|
-
/** The track identifier */
|
|
148
|
-
Identifier = "identifier",
|
|
149
|
-
/** The author of the track */
|
|
150
|
-
Author = "author",
|
|
151
|
-
/** The length of the track in milliseconds */
|
|
152
|
-
Duration = "duration",
|
|
153
|
-
/** The ISRC of the track */
|
|
154
|
-
Isrc = "isrc",
|
|
155
|
-
/** Whether the track is seekable */
|
|
156
|
-
IsSeekable = "isSeekable",
|
|
157
|
-
/** Whether the track is a stream */
|
|
158
|
-
IsStream = "isStream",
|
|
159
|
-
/** The URI of the track */
|
|
160
|
-
Uri = "uri",
|
|
161
|
-
/** The artwork URL of the track */
|
|
162
|
-
ArtworkUrl = "artworkUrl",
|
|
163
|
-
/** The source name of the track */
|
|
164
|
-
SourceName = "sourceName",
|
|
165
|
-
/** The thumbnail of the track */
|
|
166
|
-
ThumbNail = "thumbnail",
|
|
167
|
-
/** The requester of the track */
|
|
168
|
-
Requester = "requester",
|
|
169
|
-
/** The plugin info of the track */
|
|
170
|
-
PluginInfo = "pluginInfo",
|
|
171
|
-
/** The custom data of the track */
|
|
172
|
-
CustomData = "customData",
|
|
173
|
-
/** Whether the track got autoplayed */
|
|
174
|
-
IsAutoPlay = "isAutoplay"
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Manager Event Types Enum
|
|
178
|
-
*/
|
|
179
|
-
declare enum ManagerEventTypes {
|
|
180
|
-
ChapterStarted = "chapterStarted",
|
|
181
|
-
ChaptersLoaded = "chaptersLoaded",
|
|
182
|
-
Debug = "debug",
|
|
183
|
-
LyricsFound = "lyricsFound",
|
|
184
|
-
LyricsLine = "lyricsLine",
|
|
185
|
-
LyricsNotFound = "lyricsNotFound",
|
|
186
|
-
NodeConnect = "nodeConnect",
|
|
187
|
-
NodeCreate = "nodeCreate",
|
|
188
|
-
NodeDestroy = "nodeDestroy",
|
|
189
|
-
NodeDisconnect = "nodeDisconnect",
|
|
190
|
-
NodeError = "nodeError",
|
|
191
|
-
NodeRaw = "nodeRaw",
|
|
192
|
-
NodeReconnect = "nodeReconnect",
|
|
193
|
-
PlayerCreate = "playerCreate",
|
|
194
|
-
PlayerDestroy = "playerDestroy",
|
|
195
|
-
PlayerDisconnect = "playerDisconnect",
|
|
196
|
-
PlayerMove = "playerMove",
|
|
197
|
-
PlayerRestored = "playerRestored",
|
|
198
|
-
PlayerStateUpdate = "playerStateUpdate",
|
|
199
|
-
QueueEnd = "queueEnd",
|
|
200
|
-
RestoreComplete = "restoreComplete",
|
|
201
|
-
SegmentSkipped = "segmentSkipped",
|
|
202
|
-
SegmentsLoaded = "segmentsLoaded",
|
|
203
|
-
SocketClosed = "socketClosed",
|
|
204
|
-
TrackEnd = "trackEnd",
|
|
205
|
-
TrackError = "trackError",
|
|
206
|
-
TrackStart = "trackStart",
|
|
207
|
-
TrackStuck = "trackStuck",
|
|
208
|
-
/** Nodelink */
|
|
209
|
-
VoiceReceiverDisconnect = "voiceReceiverDisconnect",
|
|
210
|
-
/** Nodelink */
|
|
211
|
-
VoiceReceiverConnect = "voiceReceiverConnect",
|
|
212
|
-
/** Nodelink */
|
|
213
|
-
VoiceReceiverError = "voiceReceiverError",
|
|
214
|
-
/** Nodelink */
|
|
215
|
-
VoiceReceiverStartSpeaking = "voiceReceiverStartSpeaking",
|
|
216
|
-
/** Nodelink */
|
|
217
|
-
VoiceReceiverEndSpeaking = "voiceReceiverEndSpeaking"
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Track End Reason Enum
|
|
221
|
-
*/
|
|
222
|
-
declare enum TrackEndReasonTypes {
|
|
223
|
-
Finished = "finished",
|
|
224
|
-
LoadFailed = "loadFailed",
|
|
225
|
-
Stopped = "stopped",
|
|
226
|
-
Replaced = "replaced",
|
|
227
|
-
Cleanup = "cleanup"
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Severity Types Enum
|
|
231
|
-
*/
|
|
232
|
-
declare enum SeverityTypes {
|
|
233
|
-
Common = "common",
|
|
234
|
-
Suspicious = "suspicious",
|
|
235
|
-
Fault = "fault"
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* SponsorBlock Segment Enum
|
|
239
|
-
*/
|
|
240
|
-
declare enum SponsorBlockSegment {
|
|
241
|
-
Filler = "filler",
|
|
242
|
-
Interaction = "interaction",
|
|
243
|
-
Intro = "intro",
|
|
244
|
-
MusicOfftopic = "music_offtopic",
|
|
245
|
-
Outro = "outro",
|
|
246
|
-
Preview = "preview",
|
|
247
|
-
SelfPromo = "selfpromo",
|
|
248
|
-
Sponsor = "sponsor"
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Available Filters Enum
|
|
252
|
-
*/
|
|
253
|
-
declare enum AvailableFilters {
|
|
254
|
-
BassBoost = "bassboost",
|
|
255
|
-
China = "china",
|
|
256
|
-
Chipmunk = "chipmunk",
|
|
257
|
-
Darthvader = "darthvader",
|
|
258
|
-
Daycore = "daycore",
|
|
259
|
-
Demon = "demon",
|
|
260
|
-
Distort = "distort",
|
|
261
|
-
Doubletime = "doubletime",
|
|
262
|
-
Earrape = "earrape",
|
|
263
|
-
EightD = "eightD",
|
|
264
|
-
Electronic = "electronic",
|
|
265
|
-
Nightcore = "nightcore",
|
|
266
|
-
Party = "party",
|
|
267
|
-
Pop = "pop",
|
|
268
|
-
Radio = "radio",
|
|
269
|
-
SetDistortion = "setDistortion",
|
|
270
|
-
SetKaraoke = "setKaraoke",
|
|
271
|
-
SetRotation = "setRotation",
|
|
272
|
-
SetTimescale = "setTimescale",
|
|
273
|
-
Slowmo = "slowmo",
|
|
274
|
-
Soft = "soft",
|
|
275
|
-
TrebleBass = "trebleBass",
|
|
276
|
-
Tremolo = "tremolo",
|
|
277
|
-
TV = "tv",
|
|
278
|
-
Vaporwave = "vaporwave",
|
|
279
|
-
Vibrato = "vibrato"
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* MagmaStream Error Codes Enum
|
|
283
|
-
*/
|
|
284
|
-
declare enum MagmaStreamErrorCode {
|
|
285
|
-
GENERAL_UNKNOWN = "MS_GENERAL_UNKNOWN",
|
|
286
|
-
GENERAL_TIMEOUT = "MS_GENERAL_TIMEOUT",
|
|
287
|
-
GENERAL_INVALID_MANAGER = "MS_GENERAL_INVALID_MANAGER",
|
|
288
|
-
INTENT_MISSING = "MS_INTENT_MISSING",
|
|
289
|
-
MANAGER_INIT_FAILED = "MS_MANAGER_INIT_FAILED",
|
|
290
|
-
MANAGER_INVALID_CONFIG = "MS_MANAGER_INVALID_CONFIG",
|
|
291
|
-
MANAGER_SHUTDOWN_FAILED = "MS_MANAGER_SHUTDOWN_FAILED",
|
|
292
|
-
MANAGER_NO_NODES = "MS_MANAGER_NO_NODES",
|
|
293
|
-
MANAGER_NODE_NOT_FOUND = "MS_MANAGER_NODE_NOT_FOUND",
|
|
294
|
-
MANAGER_SEARCH_FAILED = "MS_MANAGER_SEARCH_FAILED",
|
|
295
|
-
MANAGER_CLEANUP_INACTIVE_PLAYERS_FAILED = "MS_MANAGER_CLEANUP_INACTIVE_PLAYERS_FAILED",
|
|
296
|
-
NODE_INVALID_CONFIG = "MS_NODE_INVALID_CONFIG",
|
|
297
|
-
NODE_CONNECT_FAILED = "MS_NODE_CONNECT_FAILED",
|
|
298
|
-
NODE_RECONNECT_FAILED = "MS_NODE_RECONNECT_FAILED",
|
|
299
|
-
NODE_DISCONNECTED = "MS_NODE_DISCONNECTED",
|
|
300
|
-
NODE_PROTOCOL_ERROR = "MS_NODE_PROTOCOL_ERROR",
|
|
301
|
-
NODE_SESSION_IDS_LOAD_FAILED = "MS_NODE_SESSION_IDS_LOAD_FAILED",
|
|
302
|
-
NODE_SESSION_IDS_UPDATE_FAILED = "MS_NODE_SESSION_IDS_UPDATE_FAILED",
|
|
303
|
-
NODE_PLUGIN_ERROR = "MS_NODE_PLUGIN_ERROR",
|
|
304
|
-
PLAYER_INVALID_CONFIG = "MS_PLAYER_INVALID_CONFIG",
|
|
305
|
-
PLAYER_STATE_INVALID = "MS_PLAYER_STATE_INVALID",
|
|
306
|
-
PLAYER_QUEUE_EMPTY = "MS_PLAYER_QUEUE_EMPTY",
|
|
307
|
-
PLAYER_PREVIOUS_EMPTY = "MS_PLAYER_PREVIOUS_EMPTY",
|
|
308
|
-
PLAYER_INVALID_NOW_PLAYING_MESSAGE = "MS_PLAYER_INVALID_NOW_PLAYING_MESSAGE",
|
|
309
|
-
PLAYER_INVALID_AUTOPLAY = "MS_PLAYER_INVALID_AUTOPLAY",
|
|
310
|
-
PLAYER_INVALID_VOLUME = "MS_PLAYER_INVALID_VOLUME",
|
|
311
|
-
PLAYER_INVALID_REPEAT = "MS_PLAYER_INVALID_REPEAT",
|
|
312
|
-
PLAYER_INVALID_PAUSE = "MS_PLAYER_INVALID_PAUSE",
|
|
313
|
-
PLAYER_INVALID_SEEK = "MS_PLAYER_INVALID_SEEK",
|
|
314
|
-
PLAYER_MOVE_FAILED = "MS_PLAYER_MOVE_FAILED",
|
|
315
|
-
PLAYER_VOICE_RECEIVER_ERROR = "MS_PLAYER_VOICE_RECEIVER_ERROR",
|
|
316
|
-
QUEUE_REDIS_ERROR = "MS_QUEUE_REDIS_ERROR",
|
|
317
|
-
QUEUE_JSON_ERROR = "MS_QUEUE_JSON_ERROR",
|
|
318
|
-
QUEUE_MEMORY_ERROR = "MS_QUEUE_MEMORY_ERROR",
|
|
319
|
-
FILTER_APPLY_FAILED = "MS_FILTER_APPLY_FAILED",
|
|
320
|
-
REST_REQUEST_FAILED = "MS_REST_REQUEST_FAILED",
|
|
321
|
-
REST_UNAUTHORIZED = "MS_REST_UNAUTHORIZED",
|
|
322
|
-
UTILS_TRACK_PARTIAL_INVALID = "MS_UTILS_TRACK_PARTIAL_INVALID",
|
|
323
|
-
UTILS_TRACK_BUILD_FAILED = "MS_UTILS_TRACK_BUILD_FAILED",
|
|
324
|
-
UTILS_AUTOPLAY_BUILD_FAILED = "MS_UTILS_AUTOPLAY_BUILD_FAILED",
|
|
325
|
-
UTILS_PLAYER_SERIALIZE_FAILED = "MS_UTILS_PLAYER_SERIALIZE_FAILED",
|
|
326
|
-
PLUGIN_LOAD_FAILED = "MS_PLUGIN_LOAD_FAILED",
|
|
327
|
-
PLUGIN_RUNTIME_ERROR = "MS_PLUGIN_RUNTIME_ERROR"
|
|
328
|
-
}
|
|
329
|
-
declare const MagmaStreamErrorNumbers: Record<MagmaStreamErrorCode, number>;
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* The player's queue, the `current` property is the currently playing track, think of the rest as the up-coming tracks.
|
|
333
|
-
*/
|
|
334
|
-
declare class JsonQueue implements IQueue {
|
|
335
|
-
readonly guildId: string;
|
|
336
|
-
readonly manager: Manager;
|
|
337
|
-
/**
|
|
338
|
-
* The base path for the queue files.
|
|
339
|
-
*/
|
|
340
|
-
private basePath;
|
|
341
|
-
/**
|
|
342
|
-
* Whether the queue has been destroyed.
|
|
343
|
-
*/
|
|
344
|
-
private destroyed;
|
|
345
|
-
/**
|
|
346
|
-
* @param guildId The guild ID.
|
|
347
|
-
* @param manager The manager.
|
|
348
|
-
*/
|
|
349
|
-
constructor(guildId: string, manager: Manager);
|
|
350
|
-
/**
|
|
351
|
-
* @param track The track or tracks to add. Can be a single `Track` or an array of `Track`s.
|
|
352
|
-
* @param [offset=null] The position to add the track(s) at. If not provided, the track(s) will be added at the end of the queue.
|
|
353
|
-
*/
|
|
354
|
-
add(track: Track | Track[], offset?: number): Promise<void>;
|
|
355
|
-
/**
|
|
356
|
-
* @param track The track to add.
|
|
357
|
-
*/
|
|
358
|
-
addPrevious(track: Track | Track[]): Promise<void>;
|
|
359
|
-
/**
|
|
360
|
-
* Clears the queue.
|
|
361
|
-
*/
|
|
362
|
-
clear(): Promise<void>;
|
|
363
|
-
/**
|
|
364
|
-
* Clears the previous tracks.
|
|
365
|
-
*/
|
|
366
|
-
clearPrevious(): Promise<void>;
|
|
367
|
-
/**
|
|
368
|
-
* Removes the first track from the queue.
|
|
369
|
-
*/
|
|
370
|
-
dequeue(): Promise<Track | undefined>;
|
|
371
|
-
/**
|
|
372
|
-
* Destroys the queue and releases all resources.
|
|
373
|
-
* After calling this method, the queue must not be used again.
|
|
374
|
-
*/
|
|
375
|
-
destroy(): Promise<void>;
|
|
376
|
-
/**
|
|
377
|
-
* @returns The total duration of the queue.
|
|
378
|
-
*/
|
|
379
|
-
duration(): Promise<number>;
|
|
380
|
-
/**
|
|
381
|
-
* Adds a track to the front of the queue.
|
|
382
|
-
*/
|
|
383
|
-
enqueueFront(track: Track | Track[]): Promise<void>;
|
|
384
|
-
/**
|
|
385
|
-
* Tests whether all elements in the queue pass the test implemented by the provided function.
|
|
386
|
-
*/
|
|
387
|
-
everyAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<boolean>;
|
|
388
|
-
/**
|
|
389
|
-
* Filters the queue.
|
|
390
|
-
*/
|
|
391
|
-
filterAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<Track[]>;
|
|
392
|
-
/**
|
|
393
|
-
* Finds the first track in the queue that satisfies the provided testing function.
|
|
394
|
-
*/
|
|
395
|
-
findAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<Track | undefined>;
|
|
396
|
-
/**
|
|
397
|
-
* @returns The current track.
|
|
398
|
-
*/
|
|
399
|
-
getCurrent(): Promise<Track | null>;
|
|
400
|
-
/**
|
|
401
|
-
* @returns The previous tracks.
|
|
402
|
-
*/
|
|
403
|
-
getPrevious(): Promise<Track[]>;
|
|
404
|
-
/**
|
|
405
|
-
* @returns The tracks in the queue from start to end.
|
|
406
|
-
*/
|
|
407
|
-
getSlice(start?: number, end?: number): Promise<Track[]>;
|
|
408
|
-
/**
|
|
409
|
-
* @returns The tracks in the queue.
|
|
410
|
-
*/
|
|
411
|
-
getTracks(): Promise<Track[]>;
|
|
412
|
-
/**
|
|
413
|
-
* Maps the queue to a new array.
|
|
414
|
-
*/
|
|
415
|
-
mapAsync<T>(callback: (track: Track, index: number, array: Track[]) => T): Promise<T[]>;
|
|
416
|
-
/**
|
|
417
|
-
* Modifies the queue at the specified index.
|
|
418
|
-
*/
|
|
419
|
-
modifyAt(start: number, deleteCount?: number, ...items: Track[]): Promise<Track[]>;
|
|
420
|
-
/**
|
|
421
|
-
* @returns The newest track.
|
|
422
|
-
*/
|
|
423
|
-
popPrevious(): Promise<Track | null>;
|
|
424
|
-
/**
|
|
425
|
-
* Removes a track from the queue.
|
|
426
|
-
* @param position The position to remove the track at.
|
|
427
|
-
* @param end The end position to remove the track at.
|
|
428
|
-
*/
|
|
429
|
-
remove(position?: number): Promise<Track[]>;
|
|
430
|
-
remove(start: number, end: number): Promise<Track[]>;
|
|
431
|
-
/**
|
|
432
|
-
* Shuffles the queue by round-robin.
|
|
433
|
-
*/
|
|
434
|
-
roundRobinShuffle(): Promise<void>;
|
|
435
|
-
/**
|
|
436
|
-
* @param track The track to set.
|
|
437
|
-
*/
|
|
438
|
-
setCurrent(track: Track | null): Promise<void>;
|
|
439
|
-
/**
|
|
440
|
-
* @param track The track to set.
|
|
441
|
-
*/
|
|
442
|
-
setPrevious(track: Track | Track[]): Promise<void>;
|
|
443
|
-
/**
|
|
444
|
-
* Shuffles the queue.
|
|
445
|
-
*/
|
|
446
|
-
shuffle(): Promise<void>;
|
|
447
|
-
/**
|
|
448
|
-
* @returns The size of the queue.
|
|
449
|
-
*/
|
|
450
|
-
size(): Promise<number>;
|
|
451
|
-
/**
|
|
452
|
-
* Tests whether at least one element in the queue passes the test implemented by the provided function.
|
|
453
|
-
*/
|
|
454
|
-
someAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<boolean>;
|
|
455
|
-
/**
|
|
456
|
-
* @returns The total size of the queue.
|
|
457
|
-
*/
|
|
458
|
-
totalSize(): Promise<number>;
|
|
459
|
-
/**
|
|
460
|
-
* Shuffles the queue by user.
|
|
461
|
-
*/
|
|
462
|
-
userBlockShuffle(): Promise<void>;
|
|
463
|
-
/**
|
|
464
|
-
* @returns The current path.
|
|
465
|
-
*/
|
|
466
|
-
private get currentPath();
|
|
467
|
-
/**
|
|
468
|
-
* @param filePath The file path.
|
|
469
|
-
*/
|
|
470
|
-
private deleteFile;
|
|
471
|
-
/**
|
|
472
|
-
* Ensures the directory exists.
|
|
473
|
-
*/
|
|
474
|
-
private ensureDir;
|
|
475
|
-
/**
|
|
476
|
-
* @returns The queue.
|
|
477
|
-
*/
|
|
478
|
-
private getQueue;
|
|
479
|
-
/**
|
|
480
|
-
* @returns The previous path.
|
|
481
|
-
*/
|
|
482
|
-
private get previousPath();
|
|
483
|
-
/**
|
|
484
|
-
* @returns The queue path.
|
|
485
|
-
*/
|
|
486
|
-
private get queuePath();
|
|
487
|
-
/**
|
|
488
|
-
* @param filePath The file path.
|
|
489
|
-
* @returns The JSON data.
|
|
490
|
-
*/
|
|
491
|
-
private readJSON;
|
|
492
|
-
/**
|
|
493
|
-
* @param queue The queue.
|
|
494
|
-
*/
|
|
495
|
-
private setQueue;
|
|
496
|
-
/**
|
|
497
|
-
* @param filePath The file path.
|
|
498
|
-
* @param data The data to write.
|
|
499
|
-
*/
|
|
500
|
-
private writeJSON;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* The player's queue, the `current` property is the currently playing track, think of the rest as the up-coming tracks.
|
|
505
|
-
*/
|
|
506
|
-
declare class MemoryQueue extends Array<Track> implements IQueue {
|
|
507
|
-
/** The current track */
|
|
508
|
-
current: Track | null;
|
|
509
|
-
/** The previous tracks */
|
|
510
|
-
previous: Track[];
|
|
511
|
-
/** The Manager instance. */
|
|
512
|
-
manager: Manager;
|
|
513
|
-
/** The guild ID property. */
|
|
514
|
-
guildId: string;
|
|
515
|
-
/**
|
|
516
|
-
* Whether the queue has been destroyed.
|
|
517
|
-
*/
|
|
518
|
-
private destroyed;
|
|
519
|
-
/**
|
|
520
|
-
* Constructs a new Queue.
|
|
521
|
-
* @param guildId The guild ID.
|
|
522
|
-
* @param manager The Manager instance.
|
|
523
|
-
*/
|
|
524
|
-
constructor(guildId: string, manager: Manager);
|
|
525
|
-
/**
|
|
526
|
-
* Adds a track to the queue.
|
|
527
|
-
* @param track The track or tracks to add. Can be a single `Track` or an array of `Track`s.
|
|
528
|
-
* @param [offset=null] The position to add the track(s) at. If not provided, the track(s) will be added at the end of the queue.
|
|
529
|
-
*/
|
|
530
|
-
add(track: Track | Track[], offset?: number): void;
|
|
531
|
-
/**
|
|
532
|
-
* Adds a track to the previous tracks.
|
|
533
|
-
* @param track The track or tracks to add. Can be a single `Track` or an array of `Track`s.
|
|
534
|
-
*/
|
|
535
|
-
addPrevious(track: Track | Track[]): void;
|
|
536
|
-
/**
|
|
537
|
-
* Clears the queue.
|
|
538
|
-
* This will remove all tracks from the queue and emit a state update event.
|
|
539
|
-
*/
|
|
540
|
-
clear(): void;
|
|
541
|
-
/**
|
|
542
|
-
* Clears the previous tracks.
|
|
543
|
-
*/
|
|
544
|
-
clearPrevious(): void;
|
|
545
|
-
/**
|
|
546
|
-
* Removes the first element from the queue.
|
|
547
|
-
*/
|
|
548
|
-
dequeue(): Track | undefined;
|
|
549
|
-
/**
|
|
550
|
-
* Destroys the queue and releases all resources.
|
|
551
|
-
* After calling this method, the queue must not be used again.
|
|
552
|
-
*/
|
|
553
|
-
destroy(): void;
|
|
554
|
-
/**
|
|
555
|
-
* The total duration of the queue in milliseconds.
|
|
556
|
-
* This includes the duration of the currently playing track.
|
|
557
|
-
*/
|
|
558
|
-
duration(): number;
|
|
559
|
-
/**
|
|
560
|
-
* Adds the specified track or tracks to the front of the queue.
|
|
561
|
-
* @param track The track or tracks to add.
|
|
562
|
-
*/
|
|
563
|
-
enqueueFront(track: Track | Track[]): void;
|
|
564
|
-
/**
|
|
565
|
-
* @returns Whether all elements in the queue satisfy the provided testing function.
|
|
566
|
-
*/
|
|
567
|
-
everyAsync(callback: (track: Track, index: number, array: Track[]) => boolean): boolean;
|
|
568
|
-
/**
|
|
569
|
-
* @returns A new array with all elements that pass the test implemented by the provided function.
|
|
570
|
-
*/
|
|
571
|
-
filterAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Track[];
|
|
572
|
-
/**
|
|
573
|
-
* @returns The first element in the queue that satisfies the provided testing function.
|
|
574
|
-
*/
|
|
575
|
-
findAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Track | undefined;
|
|
576
|
-
/**
|
|
577
|
-
* @returns The current track.
|
|
578
|
-
*/
|
|
579
|
-
getCurrent(): Track | null;
|
|
580
|
-
/**
|
|
581
|
-
* @returns The previous tracks.
|
|
582
|
-
*/
|
|
583
|
-
getPrevious(): Track[];
|
|
584
|
-
/**
|
|
585
|
-
* @returns The tracks in the queue from start to end.
|
|
586
|
-
*/
|
|
587
|
-
getSlice(start?: number, end?: number): Track[];
|
|
588
|
-
/**
|
|
589
|
-
* @returns The tracks in the queue.
|
|
590
|
-
*/
|
|
591
|
-
getTracks(): Track[];
|
|
592
|
-
/**
|
|
593
|
-
* @returns A new array with the results of calling a provided function on every element in the queue.
|
|
594
|
-
*/
|
|
595
|
-
mapAsync<T>(callback: (track: Track, index: number, array: Track[]) => T): T[];
|
|
596
|
-
/**
|
|
597
|
-
* Modifies the queue at the specified index.
|
|
598
|
-
* @param start The index at which to start modifying the queue.
|
|
599
|
-
* @param deleteCount The number of elements to remove from the queue.
|
|
600
|
-
* @param items The elements to add to the queue.
|
|
601
|
-
* @returns The modified queue.
|
|
602
|
-
*/
|
|
603
|
-
modifyAt(start: number, deleteCount?: number, ...items: Track[]): Track[];
|
|
604
|
-
/**
|
|
605
|
-
* @returns The newest track.
|
|
606
|
-
*/
|
|
607
|
-
popPrevious(): Track | null;
|
|
608
|
-
/**
|
|
609
|
-
* Removes track(s) from the queue.
|
|
610
|
-
* @param startOrPosition If a single number is provided, it will be treated as the position of the track to remove.
|
|
611
|
-
* If two numbers are provided, they will be used as the start and end of a range of tracks to remove.
|
|
612
|
-
* @param end Optional, end of the range of tracks to remove.
|
|
613
|
-
* @returns The removed track(s).
|
|
614
|
-
*/
|
|
615
|
-
remove(position?: number): Track[];
|
|
616
|
-
remove(start: number, end: number): Track[];
|
|
617
|
-
/**
|
|
618
|
-
* Shuffles the queue to play tracks requested by each user one by one.
|
|
619
|
-
*/
|
|
620
|
-
roundRobinShuffle(): void;
|
|
621
|
-
/**
|
|
622
|
-
* @param track The track to set.
|
|
623
|
-
*/
|
|
624
|
-
setCurrent(track: Track | null): void;
|
|
625
|
-
/**
|
|
626
|
-
* @param tracks The tracks to set.
|
|
627
|
-
*/
|
|
628
|
-
setPrevious(tracks: Track[]): void;
|
|
629
|
-
/**
|
|
630
|
-
* Shuffles the queue.
|
|
631
|
-
* This will randomize the order of the tracks in the queue and emit a state update event.
|
|
632
|
-
*/
|
|
633
|
-
shuffle(): void;
|
|
634
|
-
/**
|
|
635
|
-
* The size of tracks in the queue.
|
|
636
|
-
* This does not include the currently playing track.
|
|
637
|
-
* @returns The size of tracks in the queue.
|
|
638
|
-
*/
|
|
639
|
-
size(): number;
|
|
640
|
-
/**
|
|
641
|
-
* @returns Whether at least one element in the queue satisfies the provided testing function.
|
|
642
|
-
*/
|
|
643
|
-
someAsync(callback: (track: Track, index: number, array: Track[]) => boolean): boolean;
|
|
644
|
-
/**
|
|
645
|
-
* The total size of tracks in the queue including the current track.
|
|
646
|
-
* This includes the current track if it is not null.
|
|
647
|
-
* @returns The total size of tracks in the queue including the current track.
|
|
648
|
-
*/
|
|
649
|
-
totalSize(): number;
|
|
650
|
-
/**
|
|
651
|
-
* Shuffles the queue to play tracks requested by each user one block at a time.
|
|
652
|
-
*/
|
|
653
|
-
userBlockShuffle(): void;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
* The player's queue, the `current` property is the currently playing track, think of the rest as the up-coming tracks.
|
|
658
|
-
*/
|
|
659
|
-
declare class RedisQueue implements IQueue {
|
|
660
|
-
readonly guildId: string;
|
|
661
|
-
readonly manager: Manager;
|
|
662
|
-
/**
|
|
663
|
-
* The prefix for the Redis keys.
|
|
664
|
-
*/
|
|
665
|
-
redisPrefix: string;
|
|
666
|
-
/**
|
|
667
|
-
* The Redis instance.
|
|
668
|
-
*/
|
|
669
|
-
private redis;
|
|
670
|
-
/**
|
|
671
|
-
* Whether the queue has been destroyed.
|
|
672
|
-
*/
|
|
673
|
-
private destroyed;
|
|
674
|
-
/**
|
|
675
|
-
* Constructs a new RedisQueue.
|
|
676
|
-
* @param guildId The guild ID.
|
|
677
|
-
* @param manager The Manager instance.
|
|
678
|
-
*/
|
|
679
|
-
constructor(guildId: string, manager: Manager);
|
|
680
|
-
/**
|
|
681
|
-
* Adds a track or tracks to the queue.
|
|
682
|
-
* @param track The track or tracks to add. Can be a single `Track` or an array of `Track`s.
|
|
683
|
-
* @param [offset=null] The position to add the track(s) at. If not provided, the track(s) will be added at the end of the queue.
|
|
684
|
-
*/
|
|
685
|
-
add(track: Track | Track[], offset?: number): Promise<void>;
|
|
686
|
-
/**
|
|
687
|
-
* Adds a track or tracks to the previous tracks.
|
|
688
|
-
* @param track The track or tracks to add.
|
|
689
|
-
*/
|
|
690
|
-
addPrevious(track: Track | Track[]): Promise<void>;
|
|
691
|
-
/**
|
|
692
|
-
* Clears the queue.
|
|
693
|
-
*/
|
|
694
|
-
clear(): Promise<void>;
|
|
695
|
-
/**
|
|
696
|
-
* Clears the previous tracks.
|
|
697
|
-
*/
|
|
698
|
-
clearPrevious(): Promise<void>;
|
|
699
|
-
/**
|
|
700
|
-
* Removes the first track from the queue.
|
|
701
|
-
*/
|
|
702
|
-
dequeue(): Promise<Track | undefined>;
|
|
703
|
-
/**
|
|
704
|
-
* Destroys the queue and releases all resources.
|
|
705
|
-
* After calling this method, the queue must not be used again.
|
|
706
|
-
*/
|
|
707
|
-
destroy(): Promise<void>;
|
|
708
|
-
/**
|
|
709
|
-
* @returns The total duration of the queue in milliseconds.
|
|
710
|
-
* This includes the duration of the currently playing track.
|
|
711
|
-
*/
|
|
712
|
-
duration(): Promise<number>;
|
|
713
|
-
/**
|
|
714
|
-
* Adds a track to the front of the queue.
|
|
715
|
-
* @param track The track or tracks to add.
|
|
716
|
-
*/
|
|
717
|
-
enqueueFront(track: Track | Track[]): Promise<void>;
|
|
718
|
-
/**
|
|
719
|
-
* Whether all tracks in the queue match the specified condition.
|
|
720
|
-
* @param callback The condition to match.
|
|
721
|
-
* @returns Whether all tracks in the queue match the specified condition.
|
|
722
|
-
*/
|
|
723
|
-
everyAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<boolean>;
|
|
724
|
-
/**
|
|
725
|
-
* Filters the tracks in the queue.
|
|
726
|
-
* @param callback The condition to match.
|
|
727
|
-
* @returns The tracks that match the condition.
|
|
728
|
-
*/
|
|
729
|
-
filterAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<Track[]>;
|
|
730
|
-
/**
|
|
731
|
-
* Finds the first track in the queue that matches the specified condition.
|
|
732
|
-
* @param callback The condition to match.
|
|
733
|
-
* @returns The first track that matches the condition.
|
|
734
|
-
*/
|
|
735
|
-
findAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<Track | undefined>;
|
|
736
|
-
/**
|
|
737
|
-
* @returns The current track.
|
|
738
|
-
*/
|
|
739
|
-
getCurrent(): Promise<Track | null>;
|
|
740
|
-
/**
|
|
741
|
-
* @returns The previous tracks.
|
|
742
|
-
*/
|
|
743
|
-
getPrevious(): Promise<Track[]>;
|
|
744
|
-
/**
|
|
745
|
-
* @returns The tracks in the queue from the start to the end.
|
|
746
|
-
*/
|
|
747
|
-
getSlice(start?: number, end?: number): Promise<Track[]>;
|
|
748
|
-
/**
|
|
749
|
-
* @returns The tracks in the queue.
|
|
750
|
-
*/
|
|
751
|
-
getTracks(): Promise<Track[]>;
|
|
752
|
-
/**
|
|
753
|
-
* Maps the tracks in the queue.
|
|
754
|
-
* @returns The tracks in the queue after the specified index.
|
|
755
|
-
*/
|
|
756
|
-
mapAsync<T>(callback: (track: Track, index: number, array: Track[]) => T): Promise<T[]>;
|
|
757
|
-
/**
|
|
758
|
-
* Modifies the queue at the specified index.
|
|
759
|
-
* @param start The start index.
|
|
760
|
-
* @param deleteCount The number of tracks to delete.
|
|
761
|
-
* @param items The tracks to insert.
|
|
762
|
-
* @returns The removed tracks.
|
|
763
|
-
*/
|
|
764
|
-
modifyAt(start: number, deleteCount?: number, ...items: Track[]): Promise<Track[]>;
|
|
765
|
-
/**
|
|
766
|
-
* Removes the newest track.
|
|
767
|
-
* @returns The newest track.
|
|
768
|
-
*/
|
|
769
|
-
popPrevious(): Promise<Track | null>;
|
|
770
|
-
/**
|
|
771
|
-
* Removes the track at the specified index.
|
|
772
|
-
* @param position The position to remove the track at.
|
|
773
|
-
* @param end The end position to remove the track at.
|
|
774
|
-
*/
|
|
775
|
-
remove(position?: number): Promise<Track[]>;
|
|
776
|
-
remove(start: number, end: number): Promise<Track[]>;
|
|
777
|
-
/**
|
|
778
|
-
* Shuffles the queue round-robin style.
|
|
779
|
-
*/
|
|
780
|
-
roundRobinShuffle(): Promise<void>;
|
|
781
|
-
/**
|
|
782
|
-
* Sets the current track.
|
|
783
|
-
* @param track The track to set.
|
|
784
|
-
*/
|
|
785
|
-
setCurrent(track: Track | null): Promise<void>;
|
|
786
|
-
/**
|
|
787
|
-
* Sets the previous track(s).
|
|
788
|
-
* @param track The track to set.
|
|
789
|
-
*/
|
|
790
|
-
setPrevious(track: Track | Track[]): Promise<void>;
|
|
791
|
-
/**
|
|
792
|
-
* Shuffles the queue.
|
|
793
|
-
*/
|
|
794
|
-
shuffle(): Promise<void>;
|
|
795
|
-
/**
|
|
796
|
-
* @returns The size of the queue.
|
|
797
|
-
*/
|
|
798
|
-
size(): Promise<number>;
|
|
799
|
-
/**
|
|
800
|
-
* @returns Whether any tracks in the queue match the specified condition.
|
|
801
|
-
*/
|
|
802
|
-
someAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<boolean>;
|
|
803
|
-
/**
|
|
804
|
-
* @returns The total size of tracks in the queue including the current track.
|
|
805
|
-
*/
|
|
806
|
-
totalSize(): Promise<number>;
|
|
807
|
-
/**
|
|
808
|
-
* Shuffles the queue, but keeps the tracks of the same user together.
|
|
809
|
-
*/
|
|
810
|
-
userBlockShuffle(): Promise<void>;
|
|
811
|
-
/**
|
|
812
|
-
* @returns The current key.
|
|
813
|
-
*/
|
|
814
|
-
private get currentKey();
|
|
815
|
-
/**
|
|
816
|
-
* Deserializes a track from a string.
|
|
817
|
-
*/
|
|
818
|
-
private deserialize;
|
|
819
|
-
/**
|
|
820
|
-
* @returns The previous key.
|
|
821
|
-
*/
|
|
822
|
-
private get previousKey();
|
|
823
|
-
/**
|
|
824
|
-
* @returns The queue key.
|
|
825
|
-
*/
|
|
826
|
-
private get queueKey();
|
|
827
|
-
/**
|
|
828
|
-
* Helper to serialize/deserialize Track
|
|
829
|
-
*/
|
|
830
|
-
private serialize;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
/**
|
|
834
|
-
* Base abstract class for all plugins.
|
|
835
|
-
* Users must extend this and implement load and unload methods.
|
|
836
|
-
*/
|
|
837
|
-
declare abstract class Plugin {
|
|
838
|
-
readonly name: string;
|
|
839
|
-
/**
|
|
840
|
-
* @param name The name of the plugin
|
|
841
|
-
*/
|
|
842
|
-
constructor(name: string);
|
|
843
|
-
/**
|
|
844
|
-
* Load the plugin.
|
|
845
|
-
* @param manager The MagmaStream Manager instance
|
|
846
|
-
*/
|
|
847
|
-
abstract load(manager: Manager): void;
|
|
848
|
-
/**
|
|
849
|
-
* Unload the plugin.
|
|
850
|
-
* Called on shutdown to gracefully cleanup resources or detach listeners.
|
|
851
|
-
* @param manager The MagmaStream Manager instance
|
|
852
|
-
*/
|
|
853
|
-
abstract unload(manager: Manager): void;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
/**
|
|
857
|
-
* Manager Options
|
|
858
|
-
*/
|
|
859
|
-
interface ManagerOptions {
|
|
860
|
-
/** The state storage options.
|
|
861
|
-
*
|
|
862
|
-
* @default { type: StateStorageType.Collection, deleteDestroyedPlayers: true }
|
|
863
|
-
*/
|
|
864
|
-
stateStorage?: StateStorageOptions;
|
|
865
|
-
/** Enable priority mode over least player count or load balancing?
|
|
866
|
-
* @default false
|
|
867
|
-
*/
|
|
868
|
-
enablePriorityMode?: boolean;
|
|
869
|
-
/** Automatically play the next track when the current one ends.
|
|
870
|
-
* @default true
|
|
871
|
-
*/
|
|
872
|
-
playNextOnEnd?: boolean;
|
|
873
|
-
/** An array of search platforms to use for autoplay. First to last matters
|
|
874
|
-
* Use enum `AutoPlayPlatform`.
|
|
875
|
-
* @default [AutoPlayPlatform.YouTube]
|
|
876
|
-
*/
|
|
877
|
-
autoPlaySearchPlatforms?: AutoPlayPlatform[];
|
|
878
|
-
/** The client ID to use. */
|
|
879
|
-
clientId?: string;
|
|
880
|
-
/** Value to use for the `Client-Name` header.
|
|
881
|
-
* @default "Magmastream"
|
|
882
|
-
*
|
|
883
|
-
* For NodeLink, leave it empty.
|
|
884
|
-
*/
|
|
885
|
-
clientName?: string;
|
|
886
|
-
/** The array of shard IDs connected to this manager instance.
|
|
887
|
-
* @default 0
|
|
888
|
-
*/
|
|
889
|
-
clusterId?: number;
|
|
890
|
-
/** List of plugins to load. */
|
|
891
|
-
enabledPlugins?: Plugin[];
|
|
892
|
-
/** The default search platform to use.
|
|
893
|
-
* Use enum `SearchPlatform`.
|
|
894
|
-
* @default SearchPlatform.YouTube
|
|
895
|
-
*/
|
|
896
|
-
defaultSearchPlatform?: SearchPlatform;
|
|
897
|
-
/** The last.fm API key.
|
|
898
|
-
* If you need to create one go here: https://www.last.fm/api/account/create.
|
|
899
|
-
* If you already have one, get it from here: https://www.last.fm/api/accounts. */
|
|
900
|
-
lastFmApiKey?: string;
|
|
901
|
-
/** The maximum number of previous tracks to store.
|
|
902
|
-
* @default 20
|
|
903
|
-
*/
|
|
904
|
-
maxPreviousTracks?: number;
|
|
905
|
-
/** The array of nodes to connect to. */
|
|
906
|
-
nodes?: NodeOptions[];
|
|
907
|
-
/** Whether the YouTube video titles should be replaced if the Author does not exactly match.
|
|
908
|
-
* @default false
|
|
909
|
-
*/
|
|
910
|
-
normalizeYouTubeTitles?: boolean;
|
|
911
|
-
/** An array of track properties to keep. `track` will always be present. */
|
|
912
|
-
trackPartial?: TrackPartial[];
|
|
913
|
-
/** Use the least amount of players or least load?
|
|
914
|
-
* Use enum `UseNodeOptions`.
|
|
915
|
-
* @default UseNodeOptions.LeastPlayers
|
|
916
|
-
*/
|
|
917
|
-
useNode?: UseNodeOptions.LeastLoad | UseNodeOptions.LeastPlayers;
|
|
918
|
-
/** Whether the manager should listen to SIGINT and SIGTERM events.
|
|
919
|
-
* @default true
|
|
920
|
-
*/
|
|
921
|
-
listenToSIGEvents?: boolean;
|
|
922
|
-
/**
|
|
923
|
-
* Function to send data to the websocket.
|
|
924
|
-
* @param id The ID of the node to send the data to.
|
|
925
|
-
* @param payload The payload to send.
|
|
926
|
-
*/
|
|
927
|
-
send?: (packet: DiscordPacket) => unknown;
|
|
928
|
-
/**
|
|
929
|
-
* Optional user cache getter.
|
|
930
|
-
* When resolving a user from a partial ID, this function will be called first.
|
|
931
|
-
* Should return the full user object if cached, or undefined if not.
|
|
932
|
-
* @param id The ID of the user to get.
|
|
933
|
-
* @returns The user object if cached, or undefined if not.
|
|
934
|
-
*/
|
|
935
|
-
getUser?: (id: string) => AnyUser | undefined;
|
|
936
|
-
/**
|
|
937
|
-
* Optional guild cache getter.
|
|
938
|
-
* When resolving a guild from a partial ID, this function will be called first.
|
|
939
|
-
* Should return the full guild object if cached, or undefined if not.
|
|
940
|
-
* @param id The ID of the guild to get.
|
|
941
|
-
* @returns The guild object if cached, or undefined if not.
|
|
942
|
-
*/
|
|
943
|
-
getGuild?: (id: string) => AnyGuild | undefined;
|
|
944
|
-
}
|
|
945
|
-
/**
|
|
946
|
-
* State Storage Options
|
|
947
|
-
*/
|
|
948
|
-
interface StateStorageOptions {
|
|
949
|
-
type: StateStorageType;
|
|
950
|
-
redisConfig?: RedisConfig;
|
|
951
|
-
jsonConfig?: JsonConfig;
|
|
952
|
-
deleteDestroyedPlayers?: boolean;
|
|
953
|
-
}
|
|
954
|
-
/**
|
|
955
|
-
* Node Options
|
|
956
|
-
*/
|
|
957
|
-
interface NodeOptions {
|
|
958
|
-
/** The host for the node. */
|
|
959
|
-
host: string;
|
|
960
|
-
/** The port for the node.
|
|
961
|
-
* @default 2333
|
|
962
|
-
*/
|
|
963
|
-
port?: number;
|
|
964
|
-
/** The password for the node.
|
|
965
|
-
* @default "youshallnotpass"
|
|
966
|
-
*/
|
|
967
|
-
password?: string;
|
|
968
|
-
/** Whether the host uses SSL.
|
|
969
|
-
* @default false
|
|
970
|
-
*/
|
|
971
|
-
useSSL?: boolean;
|
|
972
|
-
/** The identifier for the node.
|
|
973
|
-
* @default host
|
|
974
|
-
*/
|
|
975
|
-
identifier?: string;
|
|
976
|
-
/** The maxRetryAttempts for the node.
|
|
977
|
-
* @default 30
|
|
978
|
-
*/
|
|
979
|
-
maxRetryAttempts?: number;
|
|
980
|
-
/** The retryDelayMs for the node.
|
|
981
|
-
* @default 60000
|
|
982
|
-
*/
|
|
983
|
-
retryDelayMs?: number;
|
|
984
|
-
/** Whether to resume the previous session.
|
|
985
|
-
* @default false
|
|
986
|
-
*/
|
|
987
|
-
enableSessionResumeOption?: boolean;
|
|
988
|
-
/** The time in seconds the lavalink server will wait before it removes the player.
|
|
989
|
-
* @default 60
|
|
990
|
-
*/
|
|
991
|
-
sessionTimeoutSeconds?: number;
|
|
992
|
-
/** The timeout used for api calls.
|
|
993
|
-
* @default 10000
|
|
994
|
-
*/
|
|
995
|
-
apiRequestTimeoutMs?: number;
|
|
996
|
-
/** Priority of the node.
|
|
997
|
-
* @default 0
|
|
998
|
-
*/
|
|
999
|
-
nodePriority?: number;
|
|
1000
|
-
/** Whether the node is a NodeLink.
|
|
1001
|
-
* @default false
|
|
1002
|
-
*/
|
|
1003
|
-
isNodeLink?: boolean;
|
|
1004
|
-
/** Whether the node is a backup node.
|
|
1005
|
-
* @default false
|
|
1006
|
-
*/
|
|
1007
|
-
isBackup?: boolean;
|
|
1008
|
-
}
|
|
1009
|
-
/**
|
|
1010
|
-
* Portable User
|
|
1011
|
-
*/
|
|
1012
|
-
interface PortableUser {
|
|
1013
|
-
id: string;
|
|
1014
|
-
username?: string;
|
|
1015
|
-
}
|
|
1016
|
-
/**
|
|
1017
|
-
* Any user
|
|
1018
|
-
*/
|
|
1019
|
-
type AnyUser = PortableUser | User | ClientUser | User$1 | User$2 | User$3 | User$4 | ClientUser$1;
|
|
1020
|
-
/**
|
|
1021
|
-
* Portable Message
|
|
1022
|
-
*/
|
|
1023
|
-
interface PortableMessage {
|
|
1024
|
-
id: string;
|
|
1025
|
-
}
|
|
1026
|
-
/**
|
|
1027
|
-
* Any message
|
|
1028
|
-
*/
|
|
1029
|
-
type AnyMessage = PortableMessage | Message | Message$1 | Message$2 | Message$3 | Message$4;
|
|
1030
|
-
/**
|
|
1031
|
-
* Any guild
|
|
1032
|
-
*/
|
|
1033
|
-
type AnyGuild = Guild | Guild$1 | Guild$2 | Guild$3 | Guild$4<"cached">;
|
|
1034
|
-
/**
|
|
1035
|
-
* Discord Packet
|
|
1036
|
-
*/
|
|
1037
|
-
interface DiscordPacket {
|
|
1038
|
-
/**
|
|
1039
|
-
* The opcode for the payload
|
|
1040
|
-
*/
|
|
1041
|
-
op: number;
|
|
1042
|
-
/**
|
|
1043
|
-
* Event data
|
|
1044
|
-
*/
|
|
1045
|
-
d: any;
|
|
1046
|
-
/**
|
|
1047
|
-
* Sequence number, used for resuming sessions and heartbeats
|
|
1048
|
-
*/
|
|
1049
|
-
s?: number;
|
|
1050
|
-
/**
|
|
1051
|
-
* The event name for this payload
|
|
1052
|
-
*/
|
|
1053
|
-
t?: string;
|
|
1054
|
-
}
|
|
1055
|
-
/**
|
|
1056
|
-
* Player Update Voice State
|
|
1057
|
-
*/
|
|
1058
|
-
interface PlayerUpdateVoiceState {
|
|
1059
|
-
/**
|
|
1060
|
-
* The session id of the voice connection
|
|
1061
|
-
*/
|
|
1062
|
-
sessionId: string;
|
|
1063
|
-
/**
|
|
1064
|
-
* Event data
|
|
1065
|
-
*/
|
|
1066
|
-
event: VoiceServerUpdate;
|
|
1067
|
-
}
|
|
1068
|
-
/**
|
|
1069
|
-
* Voice Server Update
|
|
1070
|
-
*/
|
|
1071
|
-
interface VoiceServerUpdate {
|
|
1072
|
-
/**
|
|
1073
|
-
* The token for the session
|
|
1074
|
-
*/
|
|
1075
|
-
token: string;
|
|
1076
|
-
/**
|
|
1077
|
-
* Guild if of the voice connection
|
|
1078
|
-
*/
|
|
1079
|
-
guild_id: string;
|
|
1080
|
-
/**
|
|
1081
|
-
* The endpoint lavalink will connect to
|
|
1082
|
-
*/
|
|
1083
|
-
endpoint: string;
|
|
1084
|
-
}
|
|
1085
|
-
/**
|
|
1086
|
-
* Redis Configuration
|
|
1087
|
-
*/
|
|
1088
|
-
interface RedisConfig {
|
|
1089
|
-
host: string;
|
|
1090
|
-
port: string;
|
|
1091
|
-
password?: string;
|
|
1092
|
-
db?: number;
|
|
1093
|
-
prefix?: string;
|
|
1094
|
-
}
|
|
1095
|
-
/**
|
|
1096
|
-
* JSON Configuration
|
|
1097
|
-
*/
|
|
1098
|
-
interface JsonConfig {
|
|
1099
|
-
path: string;
|
|
1100
|
-
}
|
|
1101
|
-
/**
|
|
1102
|
-
* Player State Update Event
|
|
1103
|
-
*/
|
|
1104
|
-
type PlayerStateUpdateEvent = {
|
|
1105
|
-
changeType: PlayerStateEventTypes.TrackChange;
|
|
1106
|
-
details: TrackChangeEvent;
|
|
1107
|
-
} | {
|
|
1108
|
-
changeType: PlayerStateEventTypes.PauseChange;
|
|
1109
|
-
details: PauseChangeEvent;
|
|
1110
|
-
} | {
|
|
1111
|
-
changeType: PlayerStateEventTypes.QueueChange;
|
|
1112
|
-
details: QueueChangeEvent;
|
|
1113
|
-
} | {
|
|
1114
|
-
changeType: PlayerStateEventTypes.ConnectionChange;
|
|
1115
|
-
details: ConnectionChangeEvent;
|
|
1116
|
-
} | {
|
|
1117
|
-
changeType: PlayerStateEventTypes.AutoPlayChange;
|
|
1118
|
-
details: AutoplayChangeEvent;
|
|
1119
|
-
} | {
|
|
1120
|
-
changeType: PlayerStateEventTypes.ChannelChange;
|
|
1121
|
-
details: ChannelChangeEvent;
|
|
1122
|
-
} | {
|
|
1123
|
-
changeType: PlayerStateEventTypes.VolumeChange;
|
|
1124
|
-
details: VolumeChangeEvent;
|
|
1125
|
-
} | {
|
|
1126
|
-
changeType: PlayerStateEventTypes.RepeatChange;
|
|
1127
|
-
details: RepeatChangeEvent;
|
|
1128
|
-
} | {
|
|
1129
|
-
changeType: PlayerStateEventTypes.FilterChange;
|
|
1130
|
-
details: FilterChangeEvent;
|
|
1131
|
-
};
|
|
1132
|
-
/**
|
|
1133
|
-
* Autoplay Change Event
|
|
1134
|
-
*/
|
|
1135
|
-
interface AutoplayChangeEvent {
|
|
1136
|
-
type: "autoplay";
|
|
1137
|
-
action: "toggle";
|
|
1138
|
-
previousAutoplay: boolean | null;
|
|
1139
|
-
currentAutoplay: boolean | null;
|
|
1140
|
-
}
|
|
1141
|
-
/**
|
|
1142
|
-
* Connection Change Event
|
|
1143
|
-
*/
|
|
1144
|
-
interface ConnectionChangeEvent {
|
|
1145
|
-
type: "connection";
|
|
1146
|
-
action: "connect" | "disconnect";
|
|
1147
|
-
previousConnection: boolean | null;
|
|
1148
|
-
currentConnection: boolean | null;
|
|
1149
|
-
}
|
|
1150
|
-
interface FilterChangeEvent {
|
|
1151
|
-
type: "filter";
|
|
1152
|
-
action: "change";
|
|
1153
|
-
}
|
|
1154
|
-
/**
|
|
1155
|
-
* Repeat Change Event
|
|
1156
|
-
*/
|
|
1157
|
-
interface RepeatChangeEvent {
|
|
1158
|
-
type: "repeat";
|
|
1159
|
-
action: "dynamic" | "track" | "queue" | "none";
|
|
1160
|
-
previousRepeat: "dynamic" | "track" | "queue" | null;
|
|
1161
|
-
currentRepeat: "dynamic" | "track" | "queue" | null;
|
|
1162
|
-
}
|
|
1163
|
-
/**
|
|
1164
|
-
* Pause Change Event
|
|
1165
|
-
*/
|
|
1166
|
-
interface PauseChangeEvent {
|
|
1167
|
-
type: "pause";
|
|
1168
|
-
action: "pause" | "resume" | "toggle";
|
|
1169
|
-
previousPause: boolean | null;
|
|
1170
|
-
currentPause: boolean | null;
|
|
1171
|
-
}
|
|
1172
|
-
/**
|
|
1173
|
-
* Queue Change Event
|
|
1174
|
-
*/
|
|
1175
|
-
interface QueueChangeEvent {
|
|
1176
|
-
type: "queue";
|
|
1177
|
-
action: "add" | "remove" | "clear" | "shuffle" | "roundRobin" | "userBlock" | "autoPlayAdd";
|
|
1178
|
-
previousQueueLength: number | null;
|
|
1179
|
-
currentQueueLength: number | null;
|
|
1180
|
-
tracks?: Track[];
|
|
1181
|
-
}
|
|
1182
|
-
/**
|
|
1183
|
-
* Track Change Event
|
|
1184
|
-
*/
|
|
1185
|
-
interface TrackChangeEvent {
|
|
1186
|
-
type: "track";
|
|
1187
|
-
action: "start" | "end" | "previous" | "timeUpdate" | "autoPlay";
|
|
1188
|
-
track: Track;
|
|
1189
|
-
previousTime?: number | null;
|
|
1190
|
-
currentTime?: number | null;
|
|
1191
|
-
}
|
|
1192
|
-
/**
|
|
1193
|
-
* Volume Change Event
|
|
1194
|
-
*/
|
|
1195
|
-
interface VolumeChangeEvent {
|
|
1196
|
-
type: "volume";
|
|
1197
|
-
action: "adjust";
|
|
1198
|
-
previousVolume: number | null;
|
|
1199
|
-
currentVolume: number | null;
|
|
1200
|
-
}
|
|
1201
|
-
/**
|
|
1202
|
-
* Channel Change Event
|
|
1203
|
-
*/
|
|
1204
|
-
interface ChannelChangeEvent {
|
|
1205
|
-
type: "channel";
|
|
1206
|
-
action: "text" | "voice";
|
|
1207
|
-
previousChannel: string | null;
|
|
1208
|
-
currentChannel: string | null;
|
|
1209
|
-
}
|
|
1210
|
-
/**
|
|
1211
|
-
* Track
|
|
1212
|
-
*/
|
|
1213
|
-
interface Track {
|
|
1214
|
-
/** The base64 encoded track. */
|
|
1215
|
-
readonly track: string;
|
|
1216
|
-
/** The artwork url of the track. */
|
|
1217
|
-
readonly artworkUrl: string | null;
|
|
1218
|
-
/** The track source name. */
|
|
1219
|
-
readonly sourceName: TrackSourceName;
|
|
1220
|
-
/** The title of the track. */
|
|
1221
|
-
title: string;
|
|
1222
|
-
/** The identifier of the track. */
|
|
1223
|
-
readonly identifier: string;
|
|
1224
|
-
/** The author of the track. */
|
|
1225
|
-
author: string;
|
|
1226
|
-
/** The duration of the track. */
|
|
1227
|
-
readonly duration: number;
|
|
1228
|
-
/** The ISRC of the track. */
|
|
1229
|
-
readonly isrc: string;
|
|
1230
|
-
/** If the track is seekable. */
|
|
1231
|
-
readonly isSeekable: boolean;
|
|
1232
|
-
/** If the track is a stream.. */
|
|
1233
|
-
readonly isStream: boolean;
|
|
1234
|
-
/** The uri of the track. */
|
|
1235
|
-
readonly uri: string;
|
|
1236
|
-
/** The thumbnail of the track or null if it's a unsupported source. */
|
|
1237
|
-
readonly thumbnail: string | null;
|
|
1238
|
-
/** The user that requested the track. */
|
|
1239
|
-
requester: AnyUser;
|
|
1240
|
-
/** Displays the track thumbnail with optional size or null if it's a unsupported source. */
|
|
1241
|
-
displayThumbnail(size?: Sizes): string | null;
|
|
1242
|
-
/** Additional track info provided by plugins. */
|
|
1243
|
-
pluginInfo: TrackPluginInfo;
|
|
1244
|
-
/** Add your own data to the track. */
|
|
1245
|
-
customData: Record<string, unknown>;
|
|
1246
|
-
/** If the track got added by autoplay. */
|
|
1247
|
-
readonly isAutoplay: boolean;
|
|
1248
|
-
}
|
|
1249
|
-
/**
|
|
1250
|
-
* Track Plugin Info
|
|
1251
|
-
*/
|
|
1252
|
-
interface TrackPluginInfo {
|
|
1253
|
-
albumName?: string;
|
|
1254
|
-
albumUrl?: string;
|
|
1255
|
-
artistArtworkUrl?: string;
|
|
1256
|
-
artistUrl?: string;
|
|
1257
|
-
isPreview?: string;
|
|
1258
|
-
previewUrl?: string;
|
|
1259
|
-
}
|
|
1260
|
-
/**
|
|
1261
|
-
* Search Query
|
|
1262
|
-
*/
|
|
1263
|
-
interface SearchQuery {
|
|
1264
|
-
/** The source to search from. */
|
|
1265
|
-
source?: SearchPlatform;
|
|
1266
|
-
/** The query to search for. */
|
|
1267
|
-
query: string;
|
|
1268
|
-
}
|
|
1269
|
-
/**
|
|
1270
|
-
* Lavalink Response
|
|
1271
|
-
*/
|
|
1272
|
-
interface LavalinkResponse {
|
|
1273
|
-
loadType: LoadTypes;
|
|
1274
|
-
data: TrackData[] | PlaylistRawData;
|
|
1275
|
-
}
|
|
1276
|
-
/**
|
|
1277
|
-
* Track Data
|
|
1278
|
-
*/
|
|
1279
|
-
interface TrackData {
|
|
1280
|
-
/** The track information. */
|
|
1281
|
-
encoded: string;
|
|
1282
|
-
/** The detailed information of the track. */
|
|
1283
|
-
info: TrackDataInfo;
|
|
1284
|
-
/** Additional track info provided by plugins. */
|
|
1285
|
-
pluginInfo: Record<string, string>;
|
|
1286
|
-
}
|
|
1287
|
-
/**
|
|
1288
|
-
* Playlist Raw Data
|
|
1289
|
-
*/
|
|
1290
|
-
interface PlaylistRawData {
|
|
1291
|
-
info: {
|
|
1292
|
-
/** The playlist name. */
|
|
1293
|
-
name: string;
|
|
1294
|
-
};
|
|
1295
|
-
/** Addition info provided by plugins. */
|
|
1296
|
-
pluginInfo: object;
|
|
1297
|
-
/** The tracks of the playlist */
|
|
1298
|
-
tracks: TrackData[];
|
|
1299
|
-
}
|
|
1300
|
-
/**
|
|
1301
|
-
* Track Data Info
|
|
1302
|
-
*/
|
|
1303
|
-
interface TrackDataInfo {
|
|
1304
|
-
identifier: string;
|
|
1305
|
-
isSeekable: boolean;
|
|
1306
|
-
author: string;
|
|
1307
|
-
length: number;
|
|
1308
|
-
isrc?: string;
|
|
1309
|
-
isStream: boolean;
|
|
1310
|
-
title: string;
|
|
1311
|
-
uri?: string;
|
|
1312
|
-
artworkUrl?: string;
|
|
1313
|
-
sourceName?: TrackSourceName;
|
|
1314
|
-
}
|
|
1315
|
-
/**
|
|
1316
|
-
* LavaPlayer
|
|
1317
|
-
*/
|
|
1318
|
-
interface LavaPlayer {
|
|
1319
|
-
guildId: string;
|
|
1320
|
-
track: TrackData;
|
|
1321
|
-
volume: number;
|
|
1322
|
-
paused: boolean;
|
|
1323
|
-
state: {
|
|
1324
|
-
time: number;
|
|
1325
|
-
position: number;
|
|
1326
|
-
connected: boolean;
|
|
1327
|
-
ping: number;
|
|
1328
|
-
};
|
|
1329
|
-
voice: LavalinkVoiceStateResponse;
|
|
1330
|
-
filters: Record<string, unknown>;
|
|
1331
|
-
}
|
|
1332
|
-
/**
|
|
1333
|
-
* Error or Empty Search Result
|
|
1334
|
-
*/
|
|
1335
|
-
interface ErrorOrEmptySearchResult {
|
|
1336
|
-
/** The load type of the result. */
|
|
1337
|
-
loadType: LoadTypes.Empty | LoadTypes.Error;
|
|
1338
|
-
}
|
|
1339
|
-
/**
|
|
1340
|
-
* Track Search Result
|
|
1341
|
-
*/
|
|
1342
|
-
interface TrackSearchResult {
|
|
1343
|
-
/** The load type is always 'track' */
|
|
1344
|
-
loadType: LoadTypes.Track;
|
|
1345
|
-
/** The track obtained */
|
|
1346
|
-
tracks: [Track];
|
|
1347
|
-
}
|
|
1348
|
-
/**
|
|
1349
|
-
* Search Result
|
|
1350
|
-
*/
|
|
1351
|
-
interface SearchSearchResult {
|
|
1352
|
-
/** The load type is always 'search' */
|
|
1353
|
-
loadType: LoadTypes.Search;
|
|
1354
|
-
/** The tracks of the search result */
|
|
1355
|
-
tracks: Track[];
|
|
1356
|
-
}
|
|
1357
|
-
/**
|
|
1358
|
-
* Playlist Search Result
|
|
1359
|
-
*/
|
|
1360
|
-
interface PlaylistSearchResult {
|
|
1361
|
-
/** The playlist load type */
|
|
1362
|
-
loadType: LoadTypes.Playlist;
|
|
1363
|
-
/** The tracks of the playlist */
|
|
1364
|
-
tracks: Track[];
|
|
1365
|
-
/** The playlist info */
|
|
1366
|
-
playlist: PlaylistData;
|
|
1367
|
-
}
|
|
1368
|
-
/**
|
|
1369
|
-
* Album Search Result
|
|
1370
|
-
*/
|
|
1371
|
-
interface AlbumSearchResult {
|
|
1372
|
-
loadType: LoadTypes.Album;
|
|
1373
|
-
tracks: Track[];
|
|
1374
|
-
playlist: PlaylistData;
|
|
1375
|
-
}
|
|
1376
|
-
/**
|
|
1377
|
-
* Artist Search Result
|
|
1378
|
-
*/
|
|
1379
|
-
interface ArtistSearchResult {
|
|
1380
|
-
loadType: LoadTypes.Artist;
|
|
1381
|
-
tracks: Track[];
|
|
1382
|
-
playlist: PlaylistData;
|
|
1383
|
-
}
|
|
1384
|
-
/**
|
|
1385
|
-
* Station Search Result
|
|
1386
|
-
*/
|
|
1387
|
-
interface StationSearchResult {
|
|
1388
|
-
loadType: LoadTypes.Station;
|
|
1389
|
-
tracks: Track[];
|
|
1390
|
-
playlist: PlaylistData;
|
|
1391
|
-
}
|
|
1392
|
-
/**
|
|
1393
|
-
* Podcast Search Result
|
|
1394
|
-
*/
|
|
1395
|
-
interface PodcastSearchResult {
|
|
1396
|
-
loadType: LoadTypes.Podcast;
|
|
1397
|
-
tracks: Track[];
|
|
1398
|
-
playlist: PlaylistData;
|
|
1399
|
-
}
|
|
1400
|
-
/**
|
|
1401
|
-
* Show Search Result
|
|
1402
|
-
*/
|
|
1403
|
-
interface ShowSearchResult {
|
|
1404
|
-
loadType: LoadTypes.Show;
|
|
1405
|
-
tracks: Track[];
|
|
1406
|
-
playlist: PlaylistData;
|
|
1407
|
-
}
|
|
1408
|
-
/**
|
|
1409
|
-
* Short Search Result
|
|
1410
|
-
*/
|
|
1411
|
-
interface ShortSearchResult {
|
|
1412
|
-
loadType: LoadTypes.Short;
|
|
1413
|
-
tracks: [Track];
|
|
1414
|
-
}
|
|
1415
|
-
/**
|
|
1416
|
-
* Playlist Data
|
|
1417
|
-
*/
|
|
1418
|
-
interface PlaylistData {
|
|
1419
|
-
/** The playlist name. */
|
|
1420
|
-
name: string;
|
|
1421
|
-
/** Requester of playlist. */
|
|
1422
|
-
requester: AnyUser;
|
|
1423
|
-
/** More playlist information. */
|
|
1424
|
-
playlistInfo: PlaylistInfoData[];
|
|
1425
|
-
/** The length of the playlist. */
|
|
1426
|
-
duration: number;
|
|
1427
|
-
/** The songs of the playlist. */
|
|
1428
|
-
tracks: Track[];
|
|
1429
|
-
}
|
|
1430
|
-
/**
|
|
1431
|
-
* Playlist Info Data
|
|
1432
|
-
*/
|
|
1433
|
-
interface PlaylistInfoData {
|
|
1434
|
-
/** Url to playlist. */
|
|
1435
|
-
url: string;
|
|
1436
|
-
/** Type is always playlist in that case. */
|
|
1437
|
-
type: string;
|
|
1438
|
-
/** ArtworkUrl of playlist */
|
|
1439
|
-
artworkUrl: string;
|
|
1440
|
-
/** Number of total tracks in playlist */
|
|
1441
|
-
totalTracks: number;
|
|
1442
|
-
/** Author of playlist */
|
|
1443
|
-
author: string;
|
|
1444
|
-
}
|
|
1445
|
-
/**
|
|
1446
|
-
* Manager Events
|
|
1447
|
-
*/
|
|
1448
|
-
interface ManagerEvents {
|
|
1449
|
-
[ManagerEventTypes.ChapterStarted]: [player: Player, track: Track, payload: SponsorBlockChapterStarted];
|
|
1450
|
-
[ManagerEventTypes.ChaptersLoaded]: [player: Player, track: Track, payload: SponsorBlockChaptersLoaded];
|
|
1451
|
-
[ManagerEventTypes.Debug]: [info: string];
|
|
1452
|
-
[ManagerEventTypes.LyricsFound]: [player: Player, track: Track, payload: LyricsFoundEvent];
|
|
1453
|
-
[ManagerEventTypes.LyricsLine]: [player: Player, track: Track, payload: LyricsLineEvent];
|
|
1454
|
-
[ManagerEventTypes.LyricsNotFound]: [player: Player, track: Track, payload: LyricsNotFoundEvent];
|
|
1455
|
-
[ManagerEventTypes.NodeConnect]: [node: Node];
|
|
1456
|
-
[ManagerEventTypes.NodeCreate]: [node: Node];
|
|
1457
|
-
[ManagerEventTypes.NodeDestroy]: [node: Node];
|
|
1458
|
-
[ManagerEventTypes.NodeDisconnect]: [node: Node, reason: {
|
|
1459
|
-
code?: number;
|
|
1460
|
-
reason?: string;
|
|
1461
|
-
}];
|
|
1462
|
-
[ManagerEventTypes.NodeError]: [node: Node, error: Error];
|
|
1463
|
-
[ManagerEventTypes.NodeRaw]: [payload: unknown];
|
|
1464
|
-
[ManagerEventTypes.NodeReconnect]: [node: Node];
|
|
1465
|
-
[ManagerEventTypes.PlayerCreate]: [player: Player];
|
|
1466
|
-
[ManagerEventTypes.PlayerDestroy]: [player: Player];
|
|
1467
|
-
[ManagerEventTypes.PlayerDisconnect]: [player: Player, oldChannel: string];
|
|
1468
|
-
[ManagerEventTypes.PlayerMove]: [player: Player, oldChannel: string, newChannel: string];
|
|
1469
|
-
[ManagerEventTypes.PlayerRestored]: [player: Player, node: Node];
|
|
1470
|
-
[ManagerEventTypes.PlayerStateUpdate]: [oldPlayer: Player, newPlayer: Player, changeType: PlayerStateUpdateEvent];
|
|
1471
|
-
[ManagerEventTypes.QueueEnd]: [player: Player, track: Track, payload: TrackEndEvent];
|
|
1472
|
-
[ManagerEventTypes.RestoreComplete]: [node: Node];
|
|
1473
|
-
[ManagerEventTypes.SegmentSkipped]: [player: Player, track: Track, payload: SponsorBlockSegmentSkipped];
|
|
1474
|
-
[ManagerEventTypes.SegmentsLoaded]: [player: Player, track: Track, payload: SponsorBlockSegmentsLoaded];
|
|
1475
|
-
[ManagerEventTypes.SocketClosed]: [player: Player, payload: WebSocketClosedEvent];
|
|
1476
|
-
[ManagerEventTypes.TrackEnd]: [player: Player, track: Track, payload: TrackEndEvent];
|
|
1477
|
-
[ManagerEventTypes.TrackError]: [player: Player, track: Track, payload: TrackExceptionEvent];
|
|
1478
|
-
[ManagerEventTypes.TrackStart]: [player: Player, track: Track, payload: TrackStartEvent];
|
|
1479
|
-
[ManagerEventTypes.TrackStuck]: [player: Player, track: Track, payload: TrackStuckEvent];
|
|
1480
|
-
[ManagerEventTypes.VoiceReceiverDisconnect]: [player: Player];
|
|
1481
|
-
[ManagerEventTypes.VoiceReceiverConnect]: [player: Player];
|
|
1482
|
-
[ManagerEventTypes.VoiceReceiverError]: [player: Player, error: Error];
|
|
1483
|
-
[ManagerEventTypes.VoiceReceiverStartSpeaking]: [player: Player, data: unknown];
|
|
1484
|
-
[ManagerEventTypes.VoiceReceiverEndSpeaking]: [player: Player, data: unknown];
|
|
1485
|
-
}
|
|
1486
|
-
/**
|
|
1487
|
-
* Voice Packet
|
|
1488
|
-
*/
|
|
1489
|
-
interface VoicePacket {
|
|
1490
|
-
t?: "VOICE_SERVER_UPDATE" | "VOICE_STATE_UPDATE";
|
|
1491
|
-
d: VoiceState | VoiceServer;
|
|
1492
|
-
}
|
|
1493
|
-
/**
|
|
1494
|
-
* Voice Server
|
|
1495
|
-
*/
|
|
1496
|
-
interface VoiceServer {
|
|
1497
|
-
token: string;
|
|
1498
|
-
guild_id: string;
|
|
1499
|
-
endpoint: string;
|
|
1500
|
-
}
|
|
1501
|
-
interface Extendable {
|
|
1502
|
-
Player: typeof Player;
|
|
1503
|
-
Queue: typeof MemoryQueue | typeof RedisQueue | typeof JsonQueue;
|
|
1504
|
-
Node: typeof Node;
|
|
1505
|
-
}
|
|
1506
|
-
/**
|
|
1507
|
-
* Voice State
|
|
1508
|
-
*/
|
|
1509
|
-
interface VoiceState {
|
|
1510
|
-
op: "voiceUpdate";
|
|
1511
|
-
guildId: string;
|
|
1512
|
-
event: VoiceServer;
|
|
1513
|
-
sessionId?: string;
|
|
1514
|
-
channelId?: string;
|
|
1515
|
-
}
|
|
1516
|
-
/**
|
|
1517
|
-
* Voice State
|
|
1518
|
-
*/
|
|
1519
|
-
interface VoiceState {
|
|
1520
|
-
guild_id: string;
|
|
1521
|
-
user_id: string;
|
|
1522
|
-
session_id: string;
|
|
1523
|
-
channel_id: string;
|
|
1524
|
-
}
|
|
1525
|
-
/**
|
|
1526
|
-
* Node Message
|
|
1527
|
-
*/
|
|
1528
|
-
interface NodeMessage extends NodeStats {
|
|
1529
|
-
type: PlayerEventType;
|
|
1530
|
-
op: "stats" | "playerUpdate" | "event";
|
|
1531
|
-
guildId: string;
|
|
1532
|
-
}
|
|
1533
|
-
/**
|
|
1534
|
-
* PlayerEvent interface
|
|
1535
|
-
*/
|
|
1536
|
-
interface PlayerEvent {
|
|
1537
|
-
op: "event";
|
|
1538
|
-
type: PlayerEventType;
|
|
1539
|
-
guildId: string;
|
|
1540
|
-
}
|
|
1541
|
-
/**
|
|
1542
|
-
* Exception interface
|
|
1543
|
-
*/
|
|
1544
|
-
interface Exception {
|
|
1545
|
-
message: string;
|
|
1546
|
-
severity: SeverityTypes;
|
|
1547
|
-
cause: string;
|
|
1548
|
-
}
|
|
1549
|
-
/**
|
|
1550
|
-
* TrackStartEvent interface
|
|
1551
|
-
*/
|
|
1552
|
-
interface TrackStartEvent extends PlayerEvent {
|
|
1553
|
-
type: "TrackStartEvent";
|
|
1554
|
-
track: TrackData;
|
|
1555
|
-
}
|
|
1556
|
-
/**
|
|
1557
|
-
* TrackEndEvent interface
|
|
1558
|
-
*/
|
|
1559
|
-
interface TrackEndEvent extends PlayerEvent {
|
|
1560
|
-
type: "TrackEndEvent";
|
|
1561
|
-
track: TrackData;
|
|
1562
|
-
reason: TrackEndReasonTypes;
|
|
1563
|
-
}
|
|
1564
|
-
/**
|
|
1565
|
-
* TrackExceptionEvent interface
|
|
1566
|
-
*/
|
|
1567
|
-
interface TrackExceptionEvent extends PlayerEvent {
|
|
1568
|
-
exception?: Exception;
|
|
1569
|
-
guildId: string;
|
|
1570
|
-
type: "TrackExceptionEvent";
|
|
1571
|
-
}
|
|
1572
|
-
/**
|
|
1573
|
-
* TrackStuckEvent interface
|
|
1574
|
-
*/
|
|
1575
|
-
interface TrackStuckEvent extends PlayerEvent {
|
|
1576
|
-
type: "TrackStuckEvent";
|
|
1577
|
-
thresholdMs: number;
|
|
1578
|
-
}
|
|
1579
|
-
/**
|
|
1580
|
-
* WebSocketClosedEvent interface
|
|
1581
|
-
*/
|
|
1582
|
-
interface WebSocketClosedEvent extends PlayerEvent {
|
|
1583
|
-
type: "WebSocketClosedEvent";
|
|
1584
|
-
code: number;
|
|
1585
|
-
reason: string;
|
|
1586
|
-
byRemote: boolean;
|
|
1587
|
-
}
|
|
1588
|
-
/**
|
|
1589
|
-
* SponsorBlockSegmentsLoaded interface
|
|
1590
|
-
*/
|
|
1591
|
-
interface SponsorBlockSegmentsLoaded extends PlayerEvent {
|
|
1592
|
-
type: "SegmentsLoaded";
|
|
1593
|
-
segments: {
|
|
1594
|
-
category: string;
|
|
1595
|
-
start: number;
|
|
1596
|
-
end: number;
|
|
1597
|
-
}[];
|
|
1598
|
-
}
|
|
1599
|
-
/**
|
|
1600
|
-
* SponsorBlockSegmentSkipped interface
|
|
1601
|
-
*/
|
|
1602
|
-
interface SponsorBlockSegmentSkipped extends PlayerEvent {
|
|
1603
|
-
type: "SegmentSkipped";
|
|
1604
|
-
segment: {
|
|
1605
|
-
category: string;
|
|
1606
|
-
start: number;
|
|
1607
|
-
end: number;
|
|
1608
|
-
};
|
|
1609
|
-
}
|
|
1610
|
-
/**
|
|
1611
|
-
* SponsorBlockChapterStarted interface
|
|
1612
|
-
*/
|
|
1613
|
-
interface SponsorBlockChapterStarted extends PlayerEvent {
|
|
1614
|
-
type: "ChapterStarted";
|
|
1615
|
-
/** The chapter which started */
|
|
1616
|
-
chapter: {
|
|
1617
|
-
/** The name of the chapter */
|
|
1618
|
-
name: string;
|
|
1619
|
-
start: number;
|
|
1620
|
-
end: number;
|
|
1621
|
-
duration: number;
|
|
1622
|
-
};
|
|
1623
|
-
}
|
|
1624
|
-
/**
|
|
1625
|
-
* SponsorBlockChaptersLoaded interface
|
|
1626
|
-
*/
|
|
1627
|
-
interface SponsorBlockChaptersLoaded extends PlayerEvent {
|
|
1628
|
-
type: "ChaptersLoaded";
|
|
1629
|
-
/** All chapters loaded */
|
|
1630
|
-
chapters: {
|
|
1631
|
-
/** The name of the chapter */
|
|
1632
|
-
name: string;
|
|
1633
|
-
start: number;
|
|
1634
|
-
end: number;
|
|
1635
|
-
duration: number;
|
|
1636
|
-
}[];
|
|
1637
|
-
}
|
|
1638
|
-
/**
|
|
1639
|
-
* NodeStats interface
|
|
1640
|
-
*/
|
|
1641
|
-
interface NodeStats {
|
|
1642
|
-
/** The amount of players on the node. */
|
|
1643
|
-
players: number;
|
|
1644
|
-
/** The amount of playing players on the node. */
|
|
1645
|
-
playingPlayers: number;
|
|
1646
|
-
/** The uptime for the node. */
|
|
1647
|
-
uptime: number;
|
|
1648
|
-
/** The memory stats for the node. */
|
|
1649
|
-
memory: MemoryStats;
|
|
1650
|
-
/** The cpu stats for the node. */
|
|
1651
|
-
cpu: CPUStats;
|
|
1652
|
-
/** The frame stats for the node. */
|
|
1653
|
-
frameStats: FrameStats;
|
|
1654
|
-
}
|
|
1655
|
-
/**
|
|
1656
|
-
* NodeStats interface
|
|
1657
|
-
*/
|
|
1658
|
-
interface NodeStats {
|
|
1659
|
-
/** The amount of players on the node. */
|
|
1660
|
-
players: number;
|
|
1661
|
-
/** The amount of playing players on the node. */
|
|
1662
|
-
playingPlayers: number;
|
|
1663
|
-
/** The uptime for the node. */
|
|
1664
|
-
uptime: number;
|
|
1665
|
-
/** The memory stats for the node. */
|
|
1666
|
-
memory: MemoryStats;
|
|
1667
|
-
/** The cpu stats for the node. */
|
|
1668
|
-
cpu: CPUStats;
|
|
1669
|
-
/** The frame stats for the node. */
|
|
1670
|
-
frameStats: FrameStats;
|
|
1671
|
-
}
|
|
1672
|
-
/**
|
|
1673
|
-
* MemoryStats interface
|
|
1674
|
-
*/
|
|
1675
|
-
interface MemoryStats {
|
|
1676
|
-
/** The free memory of the allocated amount. */
|
|
1677
|
-
free: number;
|
|
1678
|
-
/** The used memory of the allocated amount. */
|
|
1679
|
-
used: number;
|
|
1680
|
-
/** The total allocated memory. */
|
|
1681
|
-
allocated: number;
|
|
1682
|
-
/** The reservable memory. */
|
|
1683
|
-
reservable: number;
|
|
1684
|
-
}
|
|
1685
|
-
/**
|
|
1686
|
-
* CPUStats interface
|
|
1687
|
-
*/
|
|
1688
|
-
interface CPUStats {
|
|
1689
|
-
/** The core amount the host machine has. */
|
|
1690
|
-
cores: number;
|
|
1691
|
-
/** The system load. */
|
|
1692
|
-
systemLoad: number;
|
|
1693
|
-
/** The lavalink load. */
|
|
1694
|
-
lavalinkLoad: number;
|
|
1695
|
-
}
|
|
1696
|
-
/**
|
|
1697
|
-
* FrameStats interface
|
|
1698
|
-
*/
|
|
1699
|
-
interface FrameStats {
|
|
1700
|
-
/** The amount of sent frames. */
|
|
1701
|
-
sent?: number;
|
|
1702
|
-
/** The amount of nulled frames. */
|
|
1703
|
-
nulled?: number;
|
|
1704
|
-
/** The amount of deficit frames. */
|
|
1705
|
-
deficit?: number;
|
|
1706
|
-
}
|
|
1707
|
-
/**
|
|
1708
|
-
* LavalinkInfo interface
|
|
1709
|
-
*/
|
|
1710
|
-
interface LavalinkInfo {
|
|
1711
|
-
version: {
|
|
1712
|
-
semver: string;
|
|
1713
|
-
major: number;
|
|
1714
|
-
minor: number;
|
|
1715
|
-
patch: number;
|
|
1716
|
-
preRelease: string;
|
|
1717
|
-
};
|
|
1718
|
-
buildTime: number;
|
|
1719
|
-
git: {
|
|
1720
|
-
branch: string;
|
|
1721
|
-
commit: string;
|
|
1722
|
-
commitTime: number;
|
|
1723
|
-
};
|
|
1724
|
-
jvm: string;
|
|
1725
|
-
lavaplayer: string;
|
|
1726
|
-
sourceManagers: string[];
|
|
1727
|
-
filters: string[];
|
|
1728
|
-
plugins: {
|
|
1729
|
-
name: string;
|
|
1730
|
-
version: string;
|
|
1731
|
-
}[];
|
|
1732
|
-
}
|
|
1733
|
-
/**
|
|
1734
|
-
* LyricsLine interface
|
|
1735
|
-
*/
|
|
1736
|
-
interface LyricsLine {
|
|
1737
|
-
timestamp: number;
|
|
1738
|
-
duration: number;
|
|
1739
|
-
line: string;
|
|
1740
|
-
plugin: object;
|
|
1741
|
-
}
|
|
1742
|
-
/**
|
|
1743
|
-
* Lyrics interface
|
|
1744
|
-
*/
|
|
1745
|
-
interface Lyrics {
|
|
1746
|
-
source: string;
|
|
1747
|
-
provider: string;
|
|
1748
|
-
text?: string;
|
|
1749
|
-
lines: LyricsLine[];
|
|
1750
|
-
plugin: object[];
|
|
1751
|
-
}
|
|
1752
|
-
/**
|
|
1753
|
-
* LyricsFoundEvent interface
|
|
1754
|
-
*/
|
|
1755
|
-
interface LyricsFoundEvent extends PlayerEvent {
|
|
1756
|
-
type: "LyricsFoundEvent";
|
|
1757
|
-
guildId: string;
|
|
1758
|
-
lyrics: Lyrics;
|
|
1759
|
-
}
|
|
1760
|
-
/**
|
|
1761
|
-
* LyricsNotFoundEvent interface
|
|
1762
|
-
*/
|
|
1763
|
-
interface LyricsNotFoundEvent extends PlayerEvent {
|
|
1764
|
-
type: "LyricsNotFoundEvent";
|
|
1765
|
-
guildId: string;
|
|
1766
|
-
}
|
|
1767
|
-
/**
|
|
1768
|
-
* LyricsLineEvent interface
|
|
1769
|
-
*/
|
|
1770
|
-
interface LyricsLineEvent extends PlayerEvent {
|
|
1771
|
-
type: "LyricsLineEvent";
|
|
1772
|
-
guildId: string;
|
|
1773
|
-
lineIndex: number;
|
|
1774
|
-
line: LyricsLine;
|
|
1775
|
-
skipped: boolean;
|
|
1776
|
-
}
|
|
1777
|
-
/**
|
|
1778
|
-
* NodeLink Get Lyrics Multiple interface
|
|
1779
|
-
*/
|
|
1780
|
-
interface NodeLinkGetLyricsMultiple {
|
|
1781
|
-
loadType: "lyricsMultiple";
|
|
1782
|
-
data: NodeLinkGetLyricsData[];
|
|
1783
|
-
}
|
|
1784
|
-
/**
|
|
1785
|
-
* NodeLink Get Lyrics Empty interface
|
|
1786
|
-
*/
|
|
1787
|
-
interface NodeLinkGetLyricsEmpty {
|
|
1788
|
-
loadType: "empty";
|
|
1789
|
-
data: Record<never, never>;
|
|
1790
|
-
}
|
|
1791
|
-
/**
|
|
1792
|
-
* NodeLink Get Lyrics Data interface
|
|
1793
|
-
*/
|
|
1794
|
-
interface NodeLinkGetLyricsData {
|
|
1795
|
-
name: string;
|
|
1796
|
-
synced: boolean;
|
|
1797
|
-
data: {
|
|
1798
|
-
startTime?: number;
|
|
1799
|
-
endTime?: number;
|
|
1800
|
-
text: string;
|
|
1801
|
-
}[];
|
|
1802
|
-
rtl: boolean;
|
|
1803
|
-
}
|
|
1804
|
-
/**
|
|
1805
|
-
* NodeLink Get Lyrics Single interface
|
|
1806
|
-
*/
|
|
1807
|
-
interface NodeLinkGetLyricsSingle {
|
|
1808
|
-
loadType: "lyricsSingle";
|
|
1809
|
-
data: NodeLinkGetLyricsData;
|
|
1810
|
-
}
|
|
1811
|
-
/**
|
|
1812
|
-
* NodeLink Get Lyrics Error interface
|
|
1813
|
-
*/
|
|
1814
|
-
interface NodeLinkGetLyricsError {
|
|
1815
|
-
loadType: "error";
|
|
1816
|
-
data: {
|
|
1817
|
-
message: string;
|
|
1818
|
-
severity: Severity;
|
|
1819
|
-
cause: string;
|
|
1820
|
-
trace?: string;
|
|
1821
|
-
};
|
|
1822
|
-
}
|
|
1823
|
-
/**
|
|
1824
|
-
* Start Speaking Event Voice Receiver Data interface
|
|
1825
|
-
*/
|
|
1826
|
-
interface StartSpeakingEventVoiceReceiverData {
|
|
1827
|
-
/**
|
|
1828
|
-
* The user ID of the user who started speaking.
|
|
1829
|
-
*/
|
|
1830
|
-
userId: string;
|
|
1831
|
-
/**
|
|
1832
|
-
* The guild ID of the guild where the user started speaking.
|
|
1833
|
-
*/
|
|
1834
|
-
guildId: string;
|
|
1835
|
-
}
|
|
1836
|
-
/**
|
|
1837
|
-
* End Speaking Event Voice Receiver Data interface
|
|
1838
|
-
*/
|
|
1839
|
-
interface EndSpeakingEventVoiceReceiverData {
|
|
1840
|
-
/**
|
|
1841
|
-
* The user ID of the user who stopped speaking.
|
|
1842
|
-
*/
|
|
1843
|
-
userId: string;
|
|
1844
|
-
/**
|
|
1845
|
-
* The guild ID of the guild where the user stopped speaking.
|
|
1846
|
-
*/
|
|
1847
|
-
guildId: string;
|
|
1848
|
-
/**
|
|
1849
|
-
* The audio data received from the user in base64.
|
|
1850
|
-
*/
|
|
1851
|
-
data: string;
|
|
1852
|
-
/**
|
|
1853
|
-
* The type of the audio data. Can be either opus or pcm. Older versions may include ogg/opus.
|
|
1854
|
-
*/
|
|
1855
|
-
type: "opus" | "pcm";
|
|
1856
|
-
}
|
|
1857
|
-
/**
|
|
1858
|
-
* Base Voice Receiver Event interface
|
|
1859
|
-
*/
|
|
1860
|
-
interface BaseVoiceReceiverEvent {
|
|
1861
|
-
op: "speak";
|
|
1862
|
-
}
|
|
1863
|
-
/**
|
|
1864
|
-
* Start Speaking Event Voice Receiver interface
|
|
1865
|
-
*/
|
|
1866
|
-
interface StartSpeakingEventVoiceReceiver extends BaseVoiceReceiverEvent {
|
|
1867
|
-
type: "startSpeakingEvent";
|
|
1868
|
-
data: StartSpeakingEventVoiceReceiverData;
|
|
1869
|
-
}
|
|
1870
|
-
/**
|
|
1871
|
-
* End Speaking Event Voice Receiver interface
|
|
1872
|
-
*/
|
|
1873
|
-
interface EndSpeakingEventVoiceReceiver extends BaseVoiceReceiverEvent {
|
|
1874
|
-
type: "endSpeakingEvent";
|
|
1875
|
-
data: EndSpeakingEventVoiceReceiverData;
|
|
1876
|
-
}
|
|
1877
|
-
/**
|
|
1878
|
-
* PlayerOptions interface
|
|
1879
|
-
*/
|
|
1880
|
-
interface PlayerOptions {
|
|
1881
|
-
/** The guild ID the Player belongs to. */
|
|
1882
|
-
guildId: string;
|
|
1883
|
-
/** The text channel the Player belongs to. */
|
|
1884
|
-
textChannelId: string;
|
|
1885
|
-
/** The voice channel the Player belongs to. */
|
|
1886
|
-
voiceChannelId?: string;
|
|
1887
|
-
/** The node identifier the Player uses. */
|
|
1888
|
-
nodeIdentifier?: string;
|
|
1889
|
-
/** The initial volume the Player will use. */
|
|
1890
|
-
volume?: number;
|
|
1891
|
-
/** If the player should mute itself. */
|
|
1892
|
-
selfMute?: boolean;
|
|
1893
|
-
/** If the player should deaf itself. */
|
|
1894
|
-
selfDeafen?: boolean;
|
|
1895
|
-
/** Whether to apply the volume as a filter. */
|
|
1896
|
-
applyVolumeAsFilter?: boolean;
|
|
1897
|
-
/** Whether to pause the player when the voice connection is disconnected. */
|
|
1898
|
-
pauseOnDisconnect?: boolean;
|
|
1899
|
-
}
|
|
1900
|
-
/**
|
|
1901
|
-
* PlayOptions interface
|
|
1902
|
-
*/
|
|
1903
|
-
interface PlayOptions {
|
|
1904
|
-
/** The position to start the track. */
|
|
1905
|
-
readonly startTime?: number;
|
|
1906
|
-
/** The position to end the track. */
|
|
1907
|
-
readonly endTime?: number;
|
|
1908
|
-
/** Whether to not replace the track if a play payload is sent. */
|
|
1909
|
-
readonly noReplace?: boolean;
|
|
1910
|
-
}
|
|
1911
|
-
/**
|
|
1912
|
-
* RestPlayOptions interface
|
|
1913
|
-
*/
|
|
1914
|
-
interface RestPlayOptions {
|
|
1915
|
-
guildId: string;
|
|
1916
|
-
data: {
|
|
1917
|
-
/** The base64 encoded track. */
|
|
1918
|
-
encodedTrack?: string;
|
|
1919
|
-
/** The track ID. */
|
|
1920
|
-
identifier?: string;
|
|
1921
|
-
/** The track time to start at. */
|
|
1922
|
-
startTime?: number;
|
|
1923
|
-
/** The track time to end at. */
|
|
1924
|
-
endTime?: number;
|
|
1925
|
-
/** The player volume level. */
|
|
1926
|
-
volume?: number;
|
|
1927
|
-
/** The player position in a track. */
|
|
1928
|
-
position?: number;
|
|
1929
|
-
/** Whether the player is paused. */
|
|
1930
|
-
paused?: boolean;
|
|
1931
|
-
/** The audio effects. */
|
|
1932
|
-
filters?: object;
|
|
1933
|
-
/** voice payload. */
|
|
1934
|
-
voice?: LavalinkVoiceStateUpdate;
|
|
1935
|
-
/** Whether to not replace the track if a play payload is sent. */
|
|
1936
|
-
noReplace?: boolean;
|
|
1937
|
-
};
|
|
1938
|
-
}
|
|
1939
|
-
/**
|
|
1940
|
-
* Lavalink voice state response
|
|
1941
|
-
*/
|
|
1942
|
-
type LavalinkVoiceStateResponse = {
|
|
1943
|
-
token: string;
|
|
1944
|
-
endpoint: string;
|
|
1945
|
-
sessionId: string;
|
|
1946
|
-
channelId: string | null;
|
|
1947
|
-
};
|
|
1948
|
-
/**
|
|
1949
|
-
* Lavalink voice state update
|
|
1950
|
-
*/
|
|
1951
|
-
type LavalinkVoiceStateUpdate = {
|
|
1952
|
-
token: string;
|
|
1953
|
-
endpoint: string;
|
|
1954
|
-
sessionId: string;
|
|
1955
|
-
channelId: string;
|
|
1956
|
-
};
|
|
1957
|
-
/**
|
|
1958
|
-
* ManagerInitOptions interface
|
|
1959
|
-
*/
|
|
1960
|
-
interface ManagerInitOptions {
|
|
1961
|
-
clientId?: string;
|
|
1962
|
-
clusterId?: number;
|
|
1963
|
-
}
|
|
1964
|
-
/**
|
|
1965
|
-
* EqualizerBand interface
|
|
1966
|
-
*/
|
|
1967
|
-
interface EqualizerBand {
|
|
1968
|
-
/** The band number being 0 to 14. */
|
|
1969
|
-
band: number;
|
|
1970
|
-
/** The gain amount being -0.25 to 1.00, 0.25 being double. */
|
|
1971
|
-
gain: number;
|
|
1972
|
-
}
|
|
1973
|
-
/** Options for adjusting the timescale of audio. */
|
|
1974
|
-
interface TimescaleOptions {
|
|
1975
|
-
speed?: number;
|
|
1976
|
-
pitch?: number;
|
|
1977
|
-
rate?: number;
|
|
1978
|
-
}
|
|
1979
|
-
/** Options for applying vibrato effect to audio. */
|
|
1980
|
-
interface VibratoOptions {
|
|
1981
|
-
frequency: number;
|
|
1982
|
-
depth: number;
|
|
1983
|
-
}
|
|
1984
|
-
/** Options for applying rotation effect to audio. */
|
|
1985
|
-
interface RotationOptions {
|
|
1986
|
-
rotationHz: number;
|
|
1987
|
-
}
|
|
1988
|
-
/** Options for applying karaoke effect to audio. */
|
|
1989
|
-
interface KaraokeOptions {
|
|
1990
|
-
level?: number;
|
|
1991
|
-
monoLevel?: number;
|
|
1992
|
-
filterBand?: number;
|
|
1993
|
-
filterWidth?: number;
|
|
1994
|
-
}
|
|
1995
|
-
/** Options for applying distortion effect to audio. */
|
|
1996
|
-
interface DistortionOptions {
|
|
1997
|
-
sinOffset?: number;
|
|
1998
|
-
sinScale?: number;
|
|
1999
|
-
cosOffset?: number;
|
|
2000
|
-
cosScale?: number;
|
|
2001
|
-
tanOffset?: number;
|
|
2002
|
-
tanScale?: number;
|
|
2003
|
-
offset?: number;
|
|
2004
|
-
scale?: number;
|
|
2005
|
-
}
|
|
2006
|
-
/** Options for applying reverb effect to audio. */
|
|
2007
|
-
interface ReverbOptions {
|
|
2008
|
-
wet?: number;
|
|
2009
|
-
dry?: number;
|
|
2010
|
-
roomSize?: number;
|
|
2011
|
-
damping?: number;
|
|
2012
|
-
}
|
|
2013
|
-
/**
|
|
2014
|
-
* Queue interface
|
|
2015
|
-
*/
|
|
2016
|
-
interface IQueue {
|
|
2017
|
-
getCurrent(): Track | Promise<Track | null>;
|
|
2018
|
-
setCurrent(track: Track | null): void | Promise<void>;
|
|
2019
|
-
getPrevious(): Track[] | Promise<Track[]>;
|
|
2020
|
-
addPrevious(track: Track | Track[]): void | Promise<void>;
|
|
2021
|
-
setPrevious(track: Track | Track[]): void | Promise<void>;
|
|
2022
|
-
/** Get newest track (index 0) */
|
|
2023
|
-
popPrevious(): Track | Promise<Track | null>;
|
|
2024
|
-
clearPrevious(): void | Promise<void>;
|
|
2025
|
-
size(): number | Promise<number>;
|
|
2026
|
-
totalSize(): number | Promise<number>;
|
|
2027
|
-
duration(): number | Promise<number>;
|
|
2028
|
-
add(track: Track | Track[], offset?: number): void | Promise<void>;
|
|
2029
|
-
remove(start?: number, end?: number): Track[] | Promise<Track[]>;
|
|
2030
|
-
clear(): void | Promise<void>;
|
|
2031
|
-
dequeue(): Track | Promise<Track | undefined>;
|
|
2032
|
-
enqueueFront(track: Track | Track[]): void | Promise<void>;
|
|
2033
|
-
getTracks(): Track[] | Promise<Track[]>;
|
|
2034
|
-
getSlice(start?: number, end?: number): Track[] | Promise<Track[]>;
|
|
2035
|
-
modifyAt(start: number, deleteCount?: number, ...items: Track[]): Track[] | Promise<Track[]>;
|
|
2036
|
-
shuffle(): void | Promise<void>;
|
|
2037
|
-
userBlockShuffle(): void | Promise<void>;
|
|
2038
|
-
roundRobinShuffle(): void | Promise<void>;
|
|
2039
|
-
mapAsync<T>(callback: (track: Track, index: number, array: Track[]) => T): T[] | Promise<T[]>;
|
|
2040
|
-
filterAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Track[] | Promise<Track[]>;
|
|
2041
|
-
findAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Track | Promise<Track | undefined>;
|
|
2042
|
-
someAsync(callback: (track: Track, index: number, array: Track[]) => boolean): boolean | Promise<boolean>;
|
|
2043
|
-
everyAsync(callback: (track: Track, index: number, array: Track[]) => boolean): boolean | Promise<boolean>;
|
|
2044
|
-
destroy(): void | Promise<void>;
|
|
2045
|
-
}
|
|
2046
|
-
/**
|
|
2047
|
-
* Sizes Enum type
|
|
2048
|
-
*/
|
|
2049
|
-
type Sizes = "0" | "1" | "2" | "3" | "default" | "mqdefault" | "hqdefault" | "maxresdefault";
|
|
2050
|
-
/**
|
|
2051
|
-
* Track Source Name Enum type
|
|
2052
|
-
*/
|
|
2053
|
-
type TrackSourceName = keyof typeof TrackSourceTypes;
|
|
2054
|
-
/**
|
|
2055
|
-
* Use Node Option Enum type
|
|
2056
|
-
*/
|
|
2057
|
-
type UseNodeOption = keyof typeof UseNodeOptions;
|
|
2058
|
-
/**
|
|
2059
|
-
* Track End Reason Enum type
|
|
2060
|
-
*/
|
|
2061
|
-
type TrackEndReason = keyof typeof TrackEndReasonTypes;
|
|
2062
|
-
/**
|
|
2063
|
-
* Player Event Type Enum type
|
|
2064
|
-
*/
|
|
2065
|
-
type PlayerEventType = "TrackStartEvent" | "TrackEndEvent" | "TrackExceptionEvent" | "TrackStuckEvent" | "WebSocketClosedEvent" | "SegmentSkipped" | "SegmentsLoaded" | "ChaptersLoaded" | "ChapterStarted" | "LyricsFoundEvent" | "LyricsNotFoundEvent" | "LyricsLineEvent";
|
|
2066
|
-
/**
|
|
2067
|
-
* Severity Types Enum type
|
|
2068
|
-
*/
|
|
2069
|
-
type Severity = keyof typeof SeverityTypes;
|
|
2070
|
-
/**
|
|
2071
|
-
* SponsorBlock Segment Events Enum type
|
|
2072
|
-
*/
|
|
2073
|
-
type SponsorBlockSegmentEvents = SponsorBlockSegmentSkipped | SponsorBlockSegmentsLoaded | SponsorBlockChapterStarted | SponsorBlockChaptersLoaded;
|
|
2074
|
-
/**
|
|
2075
|
-
* SponsorBlock Segment Event Type Enum type
|
|
2076
|
-
*/
|
|
2077
|
-
type SponsorBlockSegmentEventType = "SegmentSkipped" | "SegmentsLoaded" | "ChapterStarted" | "ChaptersLoaded";
|
|
2078
|
-
/**
|
|
2079
|
-
* Player Events Enum type
|
|
2080
|
-
*/
|
|
2081
|
-
type PlayerEvents = TrackStartEvent | TrackEndEvent | TrackStuckEvent | TrackExceptionEvent | WebSocketClosedEvent | SponsorBlockSegmentEvents | LyricsEvent;
|
|
2082
|
-
/**
|
|
2083
|
-
* Load Type Enum type
|
|
2084
|
-
*/
|
|
2085
|
-
type LoadType = keyof typeof LoadTypes;
|
|
2086
|
-
/**
|
|
2087
|
-
* NodeLink Get Lyrics Enum type
|
|
2088
|
-
*/
|
|
2089
|
-
type NodeLinkGetLyrics = NodeLinkGetLyricsSingle | NodeLinkGetLyricsMultiple | NodeLinkGetLyricsEmpty | NodeLinkGetLyricsError;
|
|
2090
|
-
/**
|
|
2091
|
-
* Voice Receiver Event Enum type
|
|
2092
|
-
*/
|
|
2093
|
-
type VoiceReceiverEvent = StartSpeakingEventVoiceReceiver | EndSpeakingEventVoiceReceiver;
|
|
2094
|
-
/**
|
|
2095
|
-
* Search Result Enum type
|
|
2096
|
-
*/
|
|
2097
|
-
type SearchResult = TrackSearchResult | SearchSearchResult | PlaylistSearchResult | ErrorOrEmptySearchResult | AlbumSearchResult | ArtistSearchResult | StationSearchResult | PodcastSearchResult | ShowSearchResult | ShortSearchResult;
|
|
2098
|
-
/**
|
|
2099
|
-
* Lyrics Event Enum type
|
|
2100
|
-
*/
|
|
2101
|
-
type LyricsEvent = LyricsFoundEvent | LyricsNotFoundEvent | LyricsLineEvent;
|
|
2102
|
-
/**
|
|
2103
|
-
* Lyrics Event Type Enum type
|
|
2104
|
-
*/
|
|
2105
|
-
type LyricsEventType = "LyricsFoundEvent" | "LyricsNotFoundEvent" | "LyricsLineEvent";
|
|
2106
|
-
|
|
2107
|
-
declare class Player {
|
|
2108
|
-
options: PlayerOptions;
|
|
2109
|
-
/** The Queue for the Player. */
|
|
2110
|
-
queue: IQueue;
|
|
2111
|
-
/** The filters applied to the audio. */
|
|
2112
|
-
filters: Filters;
|
|
2113
|
-
/** Whether the queue repeats the track. */
|
|
2114
|
-
trackRepeat: boolean;
|
|
2115
|
-
/** Whether the queue repeats the queue. */
|
|
2116
|
-
queueRepeat: boolean;
|
|
2117
|
-
/**Whether the queue repeats and shuffles after each song. */
|
|
2118
|
-
dynamicRepeat: boolean;
|
|
2119
|
-
/** The time the player is in the track. */
|
|
2120
|
-
position: number;
|
|
2121
|
-
/** Whether the player is playing. */
|
|
2122
|
-
playing: boolean;
|
|
2123
|
-
/** Whether the player is paused. */
|
|
2124
|
-
paused: boolean;
|
|
2125
|
-
/** The volume for the player */
|
|
2126
|
-
volume: number;
|
|
2127
|
-
/** The Node for the Player. */
|
|
2128
|
-
node: Node;
|
|
2129
|
-
/** The guild ID for the player. */
|
|
2130
|
-
guildId: string;
|
|
2131
|
-
/** The voice channel for the player. */
|
|
2132
|
-
voiceChannelId: string | null;
|
|
2133
|
-
/** The text channel for the player. */
|
|
2134
|
-
textChannelId: string | null;
|
|
2135
|
-
/**The now playing message. */
|
|
2136
|
-
nowPlayingMessage?: AnyMessage;
|
|
2137
|
-
/** The current state of the player. */
|
|
2138
|
-
state: StateTypes;
|
|
2139
|
-
/** The equalizer bands array. */
|
|
2140
|
-
bands: number[];
|
|
2141
|
-
/** The voice state object from Discord. */
|
|
2142
|
-
voiceState: VoiceState;
|
|
2143
|
-
/** The Manager. */
|
|
2144
|
-
manager: Manager;
|
|
2145
|
-
/** The autoplay state of the player. */
|
|
2146
|
-
isAutoplay: boolean;
|
|
2147
|
-
/** The number of times to try autoplay before emitting queueEnd. */
|
|
2148
|
-
autoplayTries: number;
|
|
2149
|
-
/** The cluster ID for the player. */
|
|
2150
|
-
clusterId: number;
|
|
2151
|
-
private readonly data;
|
|
2152
|
-
private dynamicLoopInterval;
|
|
2153
|
-
dynamicRepeatIntervalMs: number | null;
|
|
2154
|
-
private static _manager;
|
|
2155
|
-
/** Should only be used when the node is a NodeLink */
|
|
2156
|
-
protected voiceReceiverWsClient: WebSocket | null;
|
|
2157
|
-
protected isConnectToVoiceReceiver: boolean;
|
|
2158
|
-
protected voiceReceiverReconnectTimeout: NodeJS.Timeout | null;
|
|
2159
|
-
protected voiceReceiverAttempt: number;
|
|
2160
|
-
protected voiceReceiverReconnectTries: number;
|
|
2161
|
-
/**
|
|
2162
|
-
* Creates a new player, returns one if it already exists.
|
|
2163
|
-
* @param options The player options.
|
|
2164
|
-
* @see https://docs.magmastream.com/main/introduction/getting-started
|
|
2165
|
-
*/
|
|
2166
|
-
constructor(options: PlayerOptions);
|
|
2167
|
-
/**
|
|
2168
|
-
* Initializes the static properties of the Player class.
|
|
2169
|
-
* @hidden
|
|
2170
|
-
* @param manager The Manager to use.
|
|
2171
|
-
*/
|
|
2172
|
-
static init(manager: Manager): void;
|
|
2173
|
-
/**
|
|
2174
|
-
* Set custom data.
|
|
2175
|
-
* @param key - The key to set the data for.
|
|
2176
|
-
* @param value - The value to set the data to.
|
|
2177
|
-
*/
|
|
2178
|
-
set(key: string, value: unknown): void;
|
|
2179
|
-
/**
|
|
2180
|
-
* Retrieves custom data associated with a given key.
|
|
2181
|
-
* @template T - The expected type of the data.
|
|
2182
|
-
* @param {string} key - The key to retrieve the data for.
|
|
2183
|
-
* @returns {T} - The data associated with the key, cast to the specified type.
|
|
2184
|
-
*/
|
|
2185
|
-
get<T>(key: string): T;
|
|
2186
|
-
/**
|
|
2187
|
-
* Same as Manager#search() but a shortcut on the player itself.
|
|
2188
|
-
* @param query
|
|
2189
|
-
* @param requester
|
|
2190
|
-
*/
|
|
2191
|
-
search<T = unknown>(query: string | SearchQuery, requester?: T): Promise<SearchResult>;
|
|
2192
|
-
/**
|
|
2193
|
-
* Connects the player to the voice channel.
|
|
2194
|
-
* @throws {RangeError} If no voice channel has been set.
|
|
2195
|
-
* @returns {void}
|
|
2196
|
-
*/
|
|
2197
|
-
connect(): void;
|
|
2198
|
-
/**
|
|
2199
|
-
* Disconnects the player from the voice channel.
|
|
2200
|
-
* @returns {this} The player instance.
|
|
2201
|
-
*/
|
|
2202
|
-
disconnect(): Promise<this>;
|
|
2203
|
-
/**
|
|
2204
|
-
* Destroys the player and clears the queue.
|
|
2205
|
-
* @param {boolean} disconnect - Whether to disconnect the player from the voice channel.
|
|
2206
|
-
* @returns {Promise<boolean>} - Whether the player was successfully destroyed.
|
|
2207
|
-
* @emits {PlayerDestroy} - Emitted when the player is destroyed.
|
|
2208
|
-
* @emits {PlayerStateUpdate} - Emitted when the player state is updated.
|
|
2209
|
-
*/
|
|
2210
|
-
destroy(disconnect?: boolean): Promise<boolean>;
|
|
2211
|
-
/**
|
|
2212
|
-
* Sets the player voice channel.
|
|
2213
|
-
* @param {string} channel - The new voice channel ID.
|
|
2214
|
-
* @returns {this} - The player instance.
|
|
2215
|
-
* @throws {TypeError} If the channel parameter is not a string.
|
|
2216
|
-
*/
|
|
2217
|
-
setVoiceChannelId(channel: string): this;
|
|
2218
|
-
/**
|
|
2219
|
-
* Sets the player text channel.
|
|
2220
|
-
*
|
|
2221
|
-
* This method updates the text channel associated with the player. It also
|
|
2222
|
-
* emits a player state update event indicating the change in the channel.
|
|
2223
|
-
*
|
|
2224
|
-
* @param {string} channel - The new text channel ID.
|
|
2225
|
-
* @returns {this} - The player instance for method chaining.
|
|
2226
|
-
* @throws {TypeError} If the channel parameter is not a string.
|
|
2227
|
-
*/
|
|
2228
|
-
setTextChannelId(channel: string): this;
|
|
2229
|
-
/**
|
|
2230
|
-
* Sets the now playing message.
|
|
2231
|
-
*
|
|
2232
|
-
* @param message - The message of the now playing message.
|
|
2233
|
-
* @returns The now playing message.
|
|
2234
|
-
*/
|
|
2235
|
-
setNowPlayingMessage(message: AnyMessage): AnyMessage;
|
|
2236
|
-
/**
|
|
2237
|
-
* Plays the next track.
|
|
2238
|
-
*
|
|
2239
|
-
* If a track is provided, it will be played. Otherwise, the next track in the queue will be played.
|
|
2240
|
-
* If the queue is not empty, but the current track has not finished yet, it will be replaced with the provided track.
|
|
2241
|
-
*
|
|
2242
|
-
* @param {object} [optionsOrTrack] - The track to play or the options to play with.
|
|
2243
|
-
* @param {object} [playOptions] - The options to play with.
|
|
2244
|
-
*
|
|
2245
|
-
* @returns {Promise<void>}
|
|
2246
|
-
*/
|
|
2247
|
-
play(): Promise<Player>;
|
|
2248
|
-
play(track: Track): Promise<Player>;
|
|
2249
|
-
play(options: PlayOptions): Promise<Player>;
|
|
2250
|
-
play(track: Track, options: PlayOptions): Promise<Player>;
|
|
2251
|
-
/**
|
|
2252
|
-
* Sets the autoplay-state of the player.
|
|
2253
|
-
*
|
|
2254
|
-
* Autoplay is a feature that makes the player play a recommended
|
|
2255
|
-
* track when the current track ends.
|
|
2256
|
-
*
|
|
2257
|
-
* @param {boolean} autoplayState - Whether or not autoplay should be enabled.
|
|
2258
|
-
* @param {object} AutoplayUser - The user-object that should be used as the bot-user.
|
|
2259
|
-
* @param {number} [tries=3] - The number of times the player should try to find a
|
|
2260
|
-
* recommended track if the first one doesn't work.
|
|
2261
|
-
* @returns {this} - The player instance.
|
|
2262
|
-
*/
|
|
2263
|
-
setAutoplay<T = unknown>(autoplayState: boolean, AutoplayUser?: T, tries?: number): this;
|
|
2264
|
-
/**
|
|
2265
|
-
* Gets recommended tracks and returns an array of tracks.
|
|
2266
|
-
* @param {Track} track - The track to find recommendations for.
|
|
2267
|
-
* @returns {Promise<Track[]>} - Array of recommended tracks.
|
|
2268
|
-
*/
|
|
2269
|
-
getRecommendedTracks(track: Track): Promise<Track[]>;
|
|
2270
|
-
/**
|
|
2271
|
-
* Sets the volume of the player.
|
|
2272
|
-
* @param {number} volume - The new volume. Must be between 0 and 500 when using filter mode (100 = 100%).
|
|
2273
|
-
* @returns {Promise<Player>} - The updated player.
|
|
2274
|
-
* @throws {TypeError} If the volume is not a number.
|
|
2275
|
-
* @throws {RangeError} If the volume is not between 0 and 500 when using filter mode (100 = 100%).
|
|
2276
|
-
* @emits {PlayerStateUpdate} - Emitted when the volume is changed.
|
|
2277
|
-
* @example
|
|
2278
|
-
* player.setVolume(50);
|
|
2279
|
-
*/
|
|
2280
|
-
setVolume(volume: number): Promise<this>;
|
|
2281
|
-
/**
|
|
2282
|
-
* Sets the sponsorblock for the player. This will set the sponsorblock segments for the player to the given segments.
|
|
2283
|
-
* @param {SponsorBlockSegment[]} segments - The sponsorblock segments to set. Defaults to `[SponsorBlockSegment.Sponsor, SponsorBlockSegment.SelfPromo]` if not provided.
|
|
2284
|
-
* @returns {Promise<void>} The promise is resolved when the operation is complete.
|
|
2285
|
-
*/
|
|
2286
|
-
setSponsorBlock(segments?: SponsorBlockSegment[]): Promise<void>;
|
|
2287
|
-
/**
|
|
2288
|
-
* Gets the sponsorblock for the player.
|
|
2289
|
-
* @returns {Promise<SponsorBlockSegment[]>} The sponsorblock segments.
|
|
2290
|
-
*/
|
|
2291
|
-
getSponsorBlock(): Promise<SponsorBlockSegment[]>;
|
|
2292
|
-
/**
|
|
2293
|
-
* Deletes the sponsorblock for the player. This will remove all sponsorblock segments that have been set for the player.
|
|
2294
|
-
* @returns {Promise<void>}
|
|
2295
|
-
*/
|
|
2296
|
-
deleteSponsorBlock(): Promise<void>;
|
|
2297
|
-
/**
|
|
2298
|
-
* Sets the track repeat mode.
|
|
2299
|
-
* When track repeat is enabled, the current track will replay after it ends.
|
|
2300
|
-
* Disables queueRepeat and dynamicRepeat modes if enabled.
|
|
2301
|
-
*
|
|
2302
|
-
* @param repeat - A boolean indicating whether to enable track repeat.
|
|
2303
|
-
* @returns {this} - The player instance.
|
|
2304
|
-
* @throws {TypeError} If the repeat parameter is not a boolean.
|
|
2305
|
-
*/
|
|
2306
|
-
setTrackRepeat(repeat: boolean): this;
|
|
2307
|
-
/**
|
|
2308
|
-
* Sets the queue repeat.
|
|
2309
|
-
* @param repeat Whether to repeat the queue or not
|
|
2310
|
-
* @returns {this} - The player instance.
|
|
2311
|
-
* @throws {TypeError} If the repeat parameter is not a boolean
|
|
2312
|
-
*/
|
|
2313
|
-
setQueueRepeat(repeat: boolean): this;
|
|
2314
|
-
/**
|
|
2315
|
-
* Sets the queue to repeat and shuffles the queue after each song.
|
|
2316
|
-
* @param repeat "true" or "false".
|
|
2317
|
-
* @param ms After how many milliseconds to trigger dynamic repeat.
|
|
2318
|
-
* @returns {this} - The player instance.
|
|
2319
|
-
* @throws {TypeError} If the repeat parameter is not a boolean.
|
|
2320
|
-
* @throws {RangeError} If the queue size is less than or equal to 1.
|
|
2321
|
-
*/
|
|
2322
|
-
setDynamicRepeat(repeat: boolean, ms: number): Promise<this>;
|
|
2323
|
-
/**
|
|
2324
|
-
* Restarts the currently playing track from the beginning.
|
|
2325
|
-
* If there is no track playing, it will play the next track in the queue.
|
|
2326
|
-
* @returns {Promise<Player>} The current instance of the Player class for method chaining.
|
|
2327
|
-
*/
|
|
2328
|
-
restart(): Promise<Player>;
|
|
2329
|
-
/**
|
|
2330
|
-
* Stops the player and optionally removes tracks from the queue.
|
|
2331
|
-
* @param {number} [amount] The amount of tracks to remove from the queue. If not provided, removes the current track if it exists.
|
|
2332
|
-
* @returns {Promise<this>} - The player instance.
|
|
2333
|
-
* @throws {RangeError} If the amount is greater than the queue length.
|
|
2334
|
-
*/
|
|
2335
|
-
stop(amount?: number): Promise<this>;
|
|
2336
|
-
/**
|
|
2337
|
-
* Skips the current track.
|
|
2338
|
-
* @returns {this} - The player instance.
|
|
2339
|
-
* @throws {Error} If there are no tracks in the queue.
|
|
2340
|
-
* @emits {PlayerStateUpdate} - With {@link PlayerStateEventTypes.TrackChange} as the change type.
|
|
2341
|
-
*/
|
|
2342
|
-
pause(pause: boolean): Promise<this>;
|
|
2343
|
-
/**
|
|
2344
|
-
* Skips to the previous track in the queue.
|
|
2345
|
-
* @returns {this} - The player instance.
|
|
2346
|
-
* @throws {Error} If there are no previous tracks in the queue.
|
|
2347
|
-
* @emits {PlayerStateUpdate} - With {@link PlayerStateEventTypes.TrackChange} as the change type.
|
|
2348
|
-
*/
|
|
2349
|
-
previous(addBackToQueue?: boolean): Promise<this>;
|
|
2350
|
-
/**
|
|
2351
|
-
* Seeks to a given position in the currently playing track.
|
|
2352
|
-
* @param position - The position in milliseconds to seek to.
|
|
2353
|
-
* @returns {this} - The player instance.
|
|
2354
|
-
* @throws {Error} If the position is invalid.
|
|
2355
|
-
* @emits {PlayerStateUpdate} - With {@link PlayerStateEventTypes.TrackChange} as the change type.
|
|
2356
|
-
*/
|
|
2357
|
-
seek(position: number): Promise<this>;
|
|
2358
|
-
/**
|
|
2359
|
-
* Returns the current repeat state of the player.
|
|
2360
|
-
* @param player The player to get the repeat state from.
|
|
2361
|
-
* @returns The repeat state of the player, or null if it is not repeating.
|
|
2362
|
-
*/
|
|
2363
|
-
private getRepeatState;
|
|
2364
|
-
/**
|
|
2365
|
-
* Automatically moves the player to a usable node.
|
|
2366
|
-
* @returns {Promise<Player | void>} - The player instance or void if not moved.
|
|
2367
|
-
*/
|
|
2368
|
-
autoMoveNode(): Promise<Player | void>;
|
|
2369
|
-
/**
|
|
2370
|
-
* Moves the player to another node.
|
|
2371
|
-
* @param {string} identifier - The identifier of the node to move to.
|
|
2372
|
-
* @returns {Promise<Player>} - The player instance after being moved.
|
|
2373
|
-
*/
|
|
2374
|
-
moveNode(identifier: string): Promise<Player>;
|
|
2375
|
-
/**
|
|
2376
|
-
* Retrieves the data associated with the player.
|
|
2377
|
-
* @returns {Record<string, unknown>} - The data associated with the player.
|
|
2378
|
-
*/
|
|
2379
|
-
getData(): Record<string, unknown>;
|
|
2380
|
-
/**
|
|
2381
|
-
* Retrieves the dynamic loop interval of the player.
|
|
2382
|
-
* @returns {NodeJS.Timeout | null} - The dynamic loop interval of the player.
|
|
2383
|
-
*/
|
|
2384
|
-
getDynamicLoopIntervalPublic(): NodeJS.Timeout | null;
|
|
2385
|
-
/**
|
|
2386
|
-
* Retrieves the data associated with the player.
|
|
2387
|
-
* @returns {Record<string, unknown>} - The data associated with the player.
|
|
2388
|
-
*/
|
|
2389
|
-
getSerializableData(): Record<string, unknown>;
|
|
2390
|
-
/**
|
|
2391
|
-
* Retrieves the current lyrics for the playing track.
|
|
2392
|
-
* @param skipTrackSource - Indicates whether to skip the track source when fetching lyrics.
|
|
2393
|
-
* @returns {Promise<Lyrics>} - The lyrics of the current track.
|
|
2394
|
-
*/
|
|
2395
|
-
getCurrentLyrics(skipTrackSource?: boolean): Promise<Lyrics>;
|
|
2396
|
-
/**
|
|
2397
|
-
* Sets up the voice receiver for the player.
|
|
2398
|
-
* @returns {Promise<void>} - A promise that resolves when the voice receiver is set up.
|
|
2399
|
-
* @throws {Error} - If the node is not a NodeLink.
|
|
2400
|
-
*/
|
|
2401
|
-
setupVoiceReceiver(): Promise<void>;
|
|
2402
|
-
/**
|
|
2403
|
-
* Removes the voice receiver for the player.
|
|
2404
|
-
* @returns {Promise<void>} - A promise that resolves when the voice receiver is removed.
|
|
2405
|
-
* @throws {Error} - If the node is not a NodeLink.
|
|
2406
|
-
*/
|
|
2407
|
-
removeVoiceReceiver(): Promise<void>;
|
|
2408
|
-
/**
|
|
2409
|
-
* Closes the voice receiver for the player.
|
|
2410
|
-
* @param {number} code - The code to close the voice receiver with.
|
|
2411
|
-
* @param {string} reason - The reason to close the voice receiver with.
|
|
2412
|
-
* @returns {Promise<void>} - A promise that resolves when the voice receiver is closed.
|
|
2413
|
-
*/
|
|
2414
|
-
private closeVoiceReceiver;
|
|
2415
|
-
/**
|
|
2416
|
-
* Reconnects the voice receiver for the player.
|
|
2417
|
-
* @returns {Promise<void>} - A promise that resolves when the voice receiver is reconnected.
|
|
2418
|
-
*/
|
|
2419
|
-
private reconnectVoiceReceiver;
|
|
2420
|
-
/**
|
|
2421
|
-
* Disconnects the voice receiver for the player.
|
|
2422
|
-
* @returns {Promise<void>} - A promise that resolves when the voice receiver is disconnected.
|
|
2423
|
-
*/
|
|
2424
|
-
private disconnectVoiceReceiver;
|
|
2425
|
-
/**
|
|
2426
|
-
* Opens the voice receiver for the player.
|
|
2427
|
-
* @returns {Promise<void>} - A promise that resolves when the voice receiver is opened.
|
|
2428
|
-
*/
|
|
2429
|
-
private openVoiceReceiver;
|
|
2430
|
-
/**
|
|
2431
|
-
* Handles a voice receiver message.
|
|
2432
|
-
* @param {string} payload - The payload to handle.
|
|
2433
|
-
* @returns {Promise<void>} - A promise that resolves when the voice receiver message is handled.
|
|
2434
|
-
*/
|
|
2435
|
-
private onVoiceReceiverMessage;
|
|
2436
|
-
/**
|
|
2437
|
-
* Handles a voice receiver error.
|
|
2438
|
-
* @param {Error} error - The error to handle.
|
|
2439
|
-
* @returns {Promise<void>} - A promise that resolves when the voice receiver error is handled.
|
|
2440
|
-
*/
|
|
2441
|
-
private onVoiceReceiverError;
|
|
2442
|
-
/**
|
|
2443
|
-
* Updates the voice state for the player.
|
|
2444
|
-
* @returns {Promise<void>} - A promise that resolves when the voice state is updated.
|
|
2445
|
-
*/
|
|
2446
|
-
updateVoice(): Promise<void>;
|
|
2447
|
-
}
|
|
2448
|
-
|
|
2449
|
-
/** Handles the requests sent to the Lavalink REST API. */
|
|
2450
|
-
declare class Rest {
|
|
2451
|
-
/** The Node that this Rest instance is connected to. */
|
|
2452
|
-
private node;
|
|
2453
|
-
/** The ID of the current session. */
|
|
2454
|
-
private sessionId;
|
|
2455
|
-
/** The password for the Node. */
|
|
2456
|
-
private readonly password;
|
|
2457
|
-
/** The URL of the Node. */
|
|
2458
|
-
private readonly url;
|
|
2459
|
-
/** The Manager instance. */
|
|
2460
|
-
manager: Manager;
|
|
2461
|
-
/** Whether the node is a NodeLink. */
|
|
2462
|
-
isNodeLink: boolean;
|
|
2463
|
-
constructor(node: Node, manager: Manager);
|
|
2464
|
-
/**
|
|
2465
|
-
* Sets the session ID.
|
|
2466
|
-
* This method is used to set the session ID after a resume operation is done.
|
|
2467
|
-
* @param {string} sessionId The session ID to set.
|
|
2468
|
-
* @returns {string} Returns the set session ID.
|
|
2469
|
-
*/
|
|
2470
|
-
setSessionId(sessionId: string): string;
|
|
2471
|
-
/**
|
|
2472
|
-
* Retrieves one the player that is currently running on the node.
|
|
2473
|
-
* @returns {Promise<unknown>} Returns the result of the GET request.
|
|
2474
|
-
*/
|
|
2475
|
-
getPlayer(guildId: string): Promise<LavaPlayer>;
|
|
2476
|
-
/**
|
|
2477
|
-
* Sends a PATCH request to update player related data.
|
|
2478
|
-
* @param {RestPlayOptions} options The options to update the player with.
|
|
2479
|
-
* @returns {Promise<unknown>} Returns the result of the PATCH request.
|
|
2480
|
-
*/
|
|
2481
|
-
updatePlayer(options: RestPlayOptions): Promise<unknown>;
|
|
2482
|
-
/**
|
|
2483
|
-
* Sends a DELETE request to the server to destroy the player.
|
|
2484
|
-
* @param {string} guildId The guild ID of the player to destroy.
|
|
2485
|
-
* @returns {Promise<unknown>} Returns the result of the DELETE request.
|
|
2486
|
-
*/
|
|
2487
|
-
destroyPlayer(guildId: string): Promise<unknown>;
|
|
2488
|
-
/**
|
|
2489
|
-
* Updates the session status for resuming.
|
|
2490
|
-
* This method sends a PATCH request to update the session's resuming status and timeout.
|
|
2491
|
-
*
|
|
2492
|
-
* @param {boolean} resuming - Indicates whether the session should be set to resuming.
|
|
2493
|
-
* @param {number} timeout - The timeout duration for the session resume.
|
|
2494
|
-
* @returns {Promise<unknown>} The result of the PATCH request.
|
|
2495
|
-
*/
|
|
2496
|
-
updateSession(resuming: boolean, timeout: number): Promise<unknown>;
|
|
2497
|
-
/**
|
|
2498
|
-
* Sends a request to the specified endpoint and returns the response data.
|
|
2499
|
-
* @param {string} method The HTTP method to use for the request.
|
|
2500
|
-
* @param {string} endpoint The endpoint to send the request to.
|
|
2501
|
-
* @param {unknown} [body] The data to send in the request body.
|
|
2502
|
-
* @returns {Promise<unknown>} The response data of the request.
|
|
2503
|
-
*/
|
|
2504
|
-
private request;
|
|
2505
|
-
/**
|
|
2506
|
-
* Sends a GET request to the specified endpoint and returns the response data.
|
|
2507
|
-
* @param {string} endpoint The endpoint to send the GET request to.
|
|
2508
|
-
* @returns {Promise<unknown>} The response data of the GET request.
|
|
2509
|
-
*/
|
|
2510
|
-
get(endpoint: string): Promise<unknown>;
|
|
2511
|
-
/**
|
|
2512
|
-
* Sends a PATCH request to the specified endpoint and returns the response data.
|
|
2513
|
-
* @param {string} endpoint The endpoint to send the PATCH request to.
|
|
2514
|
-
* @param {unknown} body The data to send in the request body.
|
|
2515
|
-
* @returns {Promise<unknown>} The response data of the PATCH request.
|
|
2516
|
-
*/
|
|
2517
|
-
patch(endpoint: string, body: unknown): Promise<unknown>;
|
|
2518
|
-
/**
|
|
2519
|
-
* Sends a POST request to the specified endpoint and returns the response data.
|
|
2520
|
-
* @param {string} endpoint The endpoint to send the POST request to.
|
|
2521
|
-
* @param {unknown} body The data to send in the request body.
|
|
2522
|
-
* @returns {Promise<unknown>} The response data of the POST request.
|
|
2523
|
-
*/
|
|
2524
|
-
post(endpoint: string, body: unknown): Promise<unknown>;
|
|
2525
|
-
/**
|
|
2526
|
-
* Sends a PUT request to the specified endpoint and returns the response data.
|
|
2527
|
-
* @param {string} endpoint The endpoint to send the PUT request to.
|
|
2528
|
-
* @param {unknown} body The data to send in the request body.
|
|
2529
|
-
* @returns {Promise<unknown>} The response data of the PUT request.
|
|
2530
|
-
*/
|
|
2531
|
-
put(endpoint: string, body: unknown): Promise<unknown>;
|
|
2532
|
-
/**
|
|
2533
|
-
* Sends a DELETE request to the specified endpoint.
|
|
2534
|
-
* @param {string} endpoint - The endpoint to send the DELETE request to.
|
|
2535
|
-
* @returns {Promise<unknown>} The response data of the DELETE request.
|
|
2536
|
-
*/
|
|
2537
|
-
delete(endpoint: string): Promise<unknown>;
|
|
2538
|
-
}
|
|
2539
|
-
|
|
2540
|
-
declare class Node {
|
|
2541
|
-
manager: Manager;
|
|
2542
|
-
options: NodeOptions;
|
|
2543
|
-
/** The socket for the node. */
|
|
2544
|
-
socket: WebSocket$1 | null;
|
|
2545
|
-
/** The stats for the node. */
|
|
2546
|
-
stats: NodeStats;
|
|
2547
|
-
/** The manager for the node */
|
|
2548
|
-
/** The node's session ID. */
|
|
2549
|
-
sessionId: string | null;
|
|
2550
|
-
/** The REST instance. */
|
|
2551
|
-
readonly rest: Rest;
|
|
2552
|
-
/** Actual Lavalink information of the node. */
|
|
2553
|
-
info: LavalinkInfo | null;
|
|
2554
|
-
/** Whether the node is a NodeLink. */
|
|
2555
|
-
isNodeLink: boolean;
|
|
2556
|
-
private reconnectTimeout?;
|
|
2557
|
-
private reconnectAttempts;
|
|
2558
|
-
private redisPrefix?;
|
|
2559
|
-
private sessionIdsMap;
|
|
2560
|
-
/**
|
|
2561
|
-
* Creates an instance of Node.
|
|
2562
|
-
* @param manager - The manager for the node.
|
|
2563
|
-
* @param options - The options for the node.
|
|
2564
|
-
*/
|
|
2565
|
-
constructor(manager: Manager, options: NodeOptions);
|
|
2566
|
-
/**
|
|
2567
|
-
* Checks if the Node is currently connected.
|
|
2568
|
-
* This method returns true if the Node has an active WebSocket connection, indicating it is ready to receive and process commands.
|
|
2569
|
-
*/
|
|
2570
|
-
get connected(): boolean;
|
|
2571
|
-
/** Returns the full address for this node, including the host and port. */
|
|
2572
|
-
get address(): string;
|
|
2573
|
-
private getCompositeKey;
|
|
2574
|
-
private getRedisSessionIdsKey;
|
|
2575
|
-
private getNodeSessionsDir;
|
|
2576
|
-
private getNodeSessionPath;
|
|
2577
|
-
/**
|
|
2578
|
-
* Loads session IDs from the sessionIds.json file if it exists.
|
|
2579
|
-
* The session IDs are used to resume sessions for each node.
|
|
2580
|
-
*
|
|
2581
|
-
* The session IDs are stored in the sessionIds.json file as a composite key
|
|
2582
|
-
* of the node identifier and cluster ID. This allows multiple clusters to
|
|
2583
|
-
* be used with the same node identifier.
|
|
2584
|
-
*/
|
|
2585
|
-
loadSessionIds(): Promise<void>;
|
|
2586
|
-
/**
|
|
2587
|
-
* Updates the session ID in the sessionIds.json file.
|
|
2588
|
-
*
|
|
2589
|
-
* This method is called after the session ID has been updated, and it
|
|
2590
|
-
* writes the new session ID to the sessionIds.json file.
|
|
2591
|
-
*
|
|
2592
|
-
* @remarks
|
|
2593
|
-
* The session ID is stored in the sessionIds.json file as a composite key
|
|
2594
|
-
* of the node identifier and cluster ID. This allows multiple clusters to
|
|
2595
|
-
* be used with the same node identifier.
|
|
2596
|
-
*/
|
|
2597
|
-
updateSessionId(): Promise<void>;
|
|
2598
|
-
private updateSessionIdFile;
|
|
2599
|
-
private updateSessionIdRedis;
|
|
2600
|
-
/**
|
|
2601
|
-
* Connects to the Node.
|
|
2602
|
-
*
|
|
2603
|
-
* @remarks
|
|
2604
|
-
* If the node is already connected, this method will do nothing.
|
|
2605
|
-
* If the node has a session ID, it will be sent in the headers of the WebSocket connection.
|
|
2606
|
-
* If the node has no session ID but the `enableSessionResumeOption` option is true, it will use the session ID
|
|
2607
|
-
* stored in the sessionIds.json file if it exists.
|
|
2608
|
-
*/
|
|
2609
|
-
connect(): Promise<void>;
|
|
2610
|
-
/**
|
|
2611
|
-
* Destroys the node and cleans up associated resources.
|
|
2612
|
-
*
|
|
2613
|
-
* This method emits a debug event indicating that the node is being destroyed and attempts
|
|
2614
|
-
* to automatically move all players connected to the node to a usable one. It then closes
|
|
2615
|
-
* the WebSocket connection, removes all event listeners, and clears the reconnect timeout.
|
|
2616
|
-
* Finally, it emits a "nodeDestroy" event and removes the node from the manager.
|
|
2617
|
-
*
|
|
2618
|
-
* @returns {Promise<void>} A promise that resolves when the node and its resources have been destroyed.
|
|
2619
|
-
*/
|
|
2620
|
-
destroy(): Promise<void>;
|
|
2621
|
-
/**
|
|
2622
|
-
* Attempts to reconnect to the node if the connection is lost.
|
|
2623
|
-
*
|
|
2624
|
-
* This method is called when the WebSocket connection is closed
|
|
2625
|
-
* unexpectedly. It will attempt to reconnect to the node after a
|
|
2626
|
-
* specified delay, and will continue to do so until the maximum
|
|
2627
|
-
* number of retry attempts is reached or the node is manually destroyed.
|
|
2628
|
-
* If the maximum number of retry attempts is reached, an error event
|
|
2629
|
-
* will be emitted and the node will be destroyed.
|
|
2630
|
-
*
|
|
2631
|
-
* @returns {Promise<void>} - Resolves when the reconnection attempt is scheduled.
|
|
2632
|
-
* @emits {debug} - Emits a debug event indicating the node is attempting to reconnect.
|
|
2633
|
-
* @emits {nodeReconnect} - Emits a nodeReconnect event when the node is attempting to reconnect.
|
|
2634
|
-
* @emits {nodeError} - Emits an error event if the maximum number of retry attempts is reached.
|
|
2635
|
-
* @emits {nodeDestroy} - Emits a nodeDestroy event if the maximum number of retry attempts is reached.
|
|
2636
|
-
*/
|
|
2637
|
-
private reconnect;
|
|
2638
|
-
/**
|
|
2639
|
-
* Upgrades the node to a NodeLink.
|
|
2640
|
-
*
|
|
2641
|
-
* @param request - The incoming message.
|
|
2642
|
-
*/
|
|
2643
|
-
private upgrade;
|
|
2644
|
-
/**
|
|
2645
|
-
* Handles the "open" event emitted by the WebSocket connection.
|
|
2646
|
-
*
|
|
2647
|
-
* This method is called when the WebSocket connection is established.
|
|
2648
|
-
* It clears any existing reconnect timeouts, emits a debug event
|
|
2649
|
-
* indicating the node is connected, and emits a "nodeConnect" event
|
|
2650
|
-
* with the node as the argument.
|
|
2651
|
-
*/
|
|
2652
|
-
protected open(): void;
|
|
2653
|
-
/**
|
|
2654
|
-
* Handles the "close" event emitted by the WebSocket connection.
|
|
2655
|
-
*
|
|
2656
|
-
* This method is called when the WebSocket connection is closed.
|
|
2657
|
-
* It emits a "nodeDisconnect" event with the node and the close event as arguments,
|
|
2658
|
-
* and a debug event indicating the node is disconnected.
|
|
2659
|
-
* It then attempts to move all players connected to that node to a useable one.
|
|
2660
|
-
* If the close event was not initiated by the user, it will also attempt to reconnect.
|
|
2661
|
-
*
|
|
2662
|
-
* @param {number} code The close code of the WebSocket connection.
|
|
2663
|
-
* @param {string} reason The reason for the close event.
|
|
2664
|
-
* @returns {Promise<void>} A promise that resolves when the disconnection is handled.
|
|
2665
|
-
*/
|
|
2666
|
-
protected close(code: number, reason: string): Promise<void>;
|
|
2667
|
-
/**
|
|
2668
|
-
* Handles the "error" event emitted by the WebSocket connection.
|
|
2669
|
-
*
|
|
2670
|
-
* This method is called when an error occurs on the WebSocket connection.
|
|
2671
|
-
* It emits a "nodeError" event with the node and the error as arguments and
|
|
2672
|
-
* a debug event indicating the error on the node.
|
|
2673
|
-
* @param {Error} error The error that occurred.
|
|
2674
|
-
*/
|
|
2675
|
-
protected error(error: Error): void;
|
|
2676
|
-
/**
|
|
2677
|
-
* Handles incoming messages from the Lavalink WebSocket connection.
|
|
2678
|
-
* @param {Buffer | string} d The message received from the WebSocket connection.
|
|
2679
|
-
* @returns {Promise<void>} A promise that resolves when the message is handled.
|
|
2680
|
-
* @emits {debug} - Emits a debug event with the message received from the WebSocket connection.
|
|
2681
|
-
* @emits {nodeError} - Emits a nodeError event if an unexpected op is received.
|
|
2682
|
-
* @emits {nodeRaw} - Emits a nodeRaw event with the raw message received from the WebSocket connection.
|
|
2683
|
-
* @private
|
|
2684
|
-
*/
|
|
2685
|
-
protected message(d: Buffer | string): Promise<void>;
|
|
2686
|
-
/**
|
|
2687
|
-
* Handles an event emitted from the Lavalink node.
|
|
2688
|
-
* @param {PlayerEvent & PlayerEvents} payload The event emitted from the node.
|
|
2689
|
-
* @returns {Promise<void>} A promise that resolves when the event has been handled.
|
|
2690
|
-
* @private
|
|
2691
|
-
*/
|
|
2692
|
-
protected handleEvent(payload: PlayerEvent & PlayerEvents): Promise<void>;
|
|
2693
|
-
/**
|
|
2694
|
-
* Emitted when a new track starts playing.
|
|
2695
|
-
* @param {Player} player The player that started playing the track.
|
|
2696
|
-
* @param {Track} track The track that started playing.
|
|
2697
|
-
* @param {TrackStartEvent} payload The payload of the event emitted by the node.
|
|
2698
|
-
* @private
|
|
2699
|
-
*/
|
|
2700
|
-
protected trackStart(player: Player, track: Track, payload: TrackStartEvent): void;
|
|
2701
|
-
/**
|
|
2702
|
-
* Emitted when a track ends playing.
|
|
2703
|
-
* @param {Player} player - The player that the track ended on.
|
|
2704
|
-
* @param {Track} track - The track that ended.
|
|
2705
|
-
* @param {TrackEndEvent} payload - The payload of the event emitted by the node.
|
|
2706
|
-
* @private
|
|
2707
|
-
*/
|
|
2708
|
-
trackEnd(player: Player, track: Track, payload: TrackEndEvent): Promise<void>;
|
|
2709
|
-
/**
|
|
2710
|
-
* Handles autoplay logic for a player.
|
|
2711
|
-
* This method is responsible for selecting an appropriate method of autoplay
|
|
2712
|
-
* and executing it. If autoplay is not enabled or all attempts have failed,
|
|
2713
|
-
* it will return false.
|
|
2714
|
-
* @param {Player} player - The player to handle autoplay for.
|
|
2715
|
-
* @param {number} attempt - The current attempt number of the autoplay.
|
|
2716
|
-
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating if autoplay was successful.
|
|
2717
|
-
* @private
|
|
2718
|
-
*/
|
|
2719
|
-
private handleAutoplay;
|
|
2720
|
-
/**
|
|
2721
|
-
* Handles the scenario when a track fails to play or load.
|
|
2722
|
-
* Shifts the queue to the next track and emits a track end event.
|
|
2723
|
-
* If there is no next track, handles the queue end scenario.
|
|
2724
|
-
* If autoplay is enabled, plays the next track.
|
|
2725
|
-
*
|
|
2726
|
-
* @param {Player} player - The player instance associated with the track.
|
|
2727
|
-
* @param {Track} track - The track that failed.
|
|
2728
|
-
* @param {TrackEndEvent} payload - The event payload containing details about the track end.
|
|
2729
|
-
* @returns {Promise<void>} A promise that resolves when the track failure has been processed.
|
|
2730
|
-
* @private
|
|
2731
|
-
*/
|
|
2732
|
-
private handleFailedTrack;
|
|
2733
|
-
/**
|
|
2734
|
-
* Handles the scenario when a track is repeated.
|
|
2735
|
-
* Shifts the queue to the next track and emits a track end event.
|
|
2736
|
-
* If there is no next track, handles the queue end scenario.
|
|
2737
|
-
* If autoplay is enabled, plays the next track.
|
|
2738
|
-
*
|
|
2739
|
-
* @param {Player} player - The player instance associated with the track.
|
|
2740
|
-
* @param {Track} track - The track that is repeated.
|
|
2741
|
-
* @param {TrackEndEvent} payload - The event payload containing details about the track end.
|
|
2742
|
-
* @returns {Promise<void>} A promise that resolves when the repeated track has been processed.
|
|
2743
|
-
* @private
|
|
2744
|
-
*/
|
|
2745
|
-
private handleRepeatedTrack;
|
|
2746
|
-
/**
|
|
2747
|
-
* Plays the next track in the queue.
|
|
2748
|
-
* Updates the queue by shifting the current track to the previous track
|
|
2749
|
-
* and plays the next track if autoplay is enabled.
|
|
2750
|
-
*
|
|
2751
|
-
* @param {Player} player - The player associated with the track.
|
|
2752
|
-
* @param {Track} track - The track that has ended.
|
|
2753
|
-
* @param {TrackEndEvent} payload - The event payload containing additional data about the track end event.
|
|
2754
|
-
* @returns {void}
|
|
2755
|
-
* @private
|
|
2756
|
-
*/
|
|
2757
|
-
private playNextTrack;
|
|
2758
|
-
/**
|
|
2759
|
-
* Handles the event when a queue ends.
|
|
2760
|
-
* If autoplay is enabled, attempts to play the next track in the queue using the autoplay logic.
|
|
2761
|
-
* If all attempts fail, resets the player state and emits the `queueEnd` event.
|
|
2762
|
-
* @param {Player} player - The player associated with the track.
|
|
2763
|
-
* @param {Track} track - The track that has ended.
|
|
2764
|
-
* @param {TrackEndEvent} payload - The event payload containing additional data about the track end event.
|
|
2765
|
-
* @returns {Promise<void>} A promise that resolves when the queue end processing is complete.
|
|
2766
|
-
*/
|
|
2767
|
-
queueEnd(player: Player, track: Track, payload: TrackEndEvent): Promise<void>;
|
|
2768
|
-
/**
|
|
2769
|
-
* Fetches the lyrics of a track from the Lavalink node.
|
|
2770
|
-
*
|
|
2771
|
-
* If the node is a NodeLink, it will use the `NodeLinkGetLyrics` method to fetch the lyrics.
|
|
2772
|
-
*
|
|
2773
|
-
* Requires the `lavalyrics-plugin` to be present in the Lavalink node.
|
|
2774
|
-
* Requires the `lavasrc-plugin` or `java-lyrics-plugin` to be present in the Lavalink node.
|
|
2775
|
-
*
|
|
2776
|
-
* @param {Track} track - The track to fetch the lyrics for.
|
|
2777
|
-
* @param {boolean} [skipTrackSource=false] - Whether to skip using the track's source URL.
|
|
2778
|
-
* @param {string} [language="en"] - The language of the lyrics.
|
|
2779
|
-
* @returns {Promise<Lyrics | NodeLinkGetLyrics>} A promise that resolves with the lyrics data.
|
|
2780
|
-
*/
|
|
2781
|
-
getLyrics(track: Track, skipTrackSource?: boolean, language?: string): Promise<Lyrics | NodeLinkGetLyrics>;
|
|
2782
|
-
/**
|
|
2783
|
-
* Subscribes to lyrics for a player.
|
|
2784
|
-
* @param {string} guildId - The ID of the guild to subscribe to lyrics for.
|
|
2785
|
-
* @param {boolean} [skipTrackSource=false] - Whether to skip using the track's source URL.
|
|
2786
|
-
* @returns {Promise<unknown>} A promise that resolves when the subscription is complete.
|
|
2787
|
-
* @throws {RangeError} If the node is not connected to the lavalink server or if the java-lyrics-plugin is not available.
|
|
2788
|
-
*/
|
|
2789
|
-
lyricsSubscribe(guildId: string, skipTrackSource?: boolean): Promise<unknown>;
|
|
2790
|
-
/**
|
|
2791
|
-
* Unsubscribes from lyrics for a player.
|
|
2792
|
-
* @param {string} guildId - The ID of the guild to unsubscribe from lyrics for.
|
|
2793
|
-
* @returns {Promise<unknown>} A promise that resolves when the unsubscription is complete.
|
|
2794
|
-
* @throws {RangeError} If the node is not connected to the lavalink server or if the java-lyrics-plugin is not available.
|
|
2795
|
-
*/
|
|
2796
|
-
lyricsUnsubscribe(guildId: string): Promise<unknown>;
|
|
2797
|
-
/**
|
|
2798
|
-
* Handles the event when a track becomes stuck during playback.
|
|
2799
|
-
* Stops the current track and emits a `trackStuck` event.
|
|
2800
|
-
*
|
|
2801
|
-
* @param {Player} player - The player associated with the track that became stuck.
|
|
2802
|
-
* @param {Track} track - The track that became stuck.
|
|
2803
|
-
* @param {TrackStuckEvent} payload - The event payload containing additional data about the track stuck event.
|
|
2804
|
-
* @returns {void}
|
|
2805
|
-
* @protected
|
|
2806
|
-
*/
|
|
2807
|
-
protected trackStuck(player: Player, track: Track, payload: TrackStuckEvent): Promise<void>;
|
|
2808
|
-
/**
|
|
2809
|
-
* Handles the event when a track has an error during playback.
|
|
2810
|
-
* Stops the current track and emits a `trackError` event.
|
|
2811
|
-
*
|
|
2812
|
-
* @param {Player} player - The player associated with the track that had an error.
|
|
2813
|
-
* @param {Track} track - The track that had an error.
|
|
2814
|
-
* @param {TrackExceptionEvent} payload - The event payload containing additional data about the track error event.
|
|
2815
|
-
* @returns {void}
|
|
2816
|
-
* @protected
|
|
2817
|
-
*/
|
|
2818
|
-
protected trackError(player: Player, track: Track, payload: TrackExceptionEvent): Promise<void>;
|
|
2819
|
-
/**
|
|
2820
|
-
* Emitted when the WebSocket connection for a player closes.
|
|
2821
|
-
* The payload of the event will contain the close code and reason if provided.
|
|
2822
|
-
* @param {Player} player - The player associated with the WebSocket connection.
|
|
2823
|
-
* @param {WebSocketClosedEvent} payload - The event payload containing additional data about the WebSocket close event.
|
|
2824
|
-
*/
|
|
2825
|
-
protected socketClosed(player: Player, payload: WebSocketClosedEvent): void;
|
|
2826
|
-
/**
|
|
2827
|
-
* Emitted when the segments for a track are loaded.
|
|
2828
|
-
* The payload of the event will contain the segments.
|
|
2829
|
-
* @param {Player} player - The player associated with the segments.
|
|
2830
|
-
* @param {Track} track - The track associated with the segments.
|
|
2831
|
-
* @param {SponsorBlockSegmentsLoaded} payload - The event payload containing additional data about the segments loaded event.
|
|
2832
|
-
*/
|
|
2833
|
-
private sponsorBlockSegmentLoaded;
|
|
2834
|
-
/**
|
|
2835
|
-
* Emitted when a segment of a track is skipped using the sponsorblock plugin.
|
|
2836
|
-
* The payload of the event will contain the skipped segment.
|
|
2837
|
-
* @param {Player} player - The player associated with the skipped segment.
|
|
2838
|
-
* @param {Track} track - The track associated with the skipped segment.
|
|
2839
|
-
* @param {SponsorBlockSegmentSkipped} payload - The event payload containing additional data about the segment skipped event.
|
|
2840
|
-
*/
|
|
2841
|
-
private sponsorBlockSegmentSkipped;
|
|
2842
|
-
/**
|
|
2843
|
-
* Emitted when chapters for a track are loaded using the sponsorblock plugin.
|
|
2844
|
-
* The payload of the event will contain the chapters.
|
|
2845
|
-
* @param {Player} player - The player associated with the chapters.
|
|
2846
|
-
* @param {Track} track - The track associated with the chapters.
|
|
2847
|
-
* @param {SponsorBlockChaptersLoaded} payload - The event payload containing additional data about the chapters loaded event.
|
|
2848
|
-
*/
|
|
2849
|
-
private sponsorBlockChaptersLoaded;
|
|
2850
|
-
/**
|
|
2851
|
-
* Emitted when a chapter of a track is started using the sponsorblock plugin.
|
|
2852
|
-
* The payload of the event will contain the started chapter.
|
|
2853
|
-
* @param {Player} player - The player associated with the started chapter.
|
|
2854
|
-
* @param {Track} track - The track associated with the started chapter.
|
|
2855
|
-
* @param {SponsorBlockChapterStarted} payload - The event payload containing additional data about the chapter started event.
|
|
2856
|
-
*/
|
|
2857
|
-
private sponsorBlockChapterStarted;
|
|
2858
|
-
/**
|
|
2859
|
-
* Emitted when lyrics for a track are found.
|
|
2860
|
-
* The payload of the event will contain the lyrics.
|
|
2861
|
-
* @param {Player} player - The player associated with the lyrics.
|
|
2862
|
-
* @param {Track} track - The track associated with the lyrics.
|
|
2863
|
-
* @param {LyricsFoundEvent} payload - The event payload containing additional data about the lyrics found event.
|
|
2864
|
-
*/
|
|
2865
|
-
private lyricsFound;
|
|
2866
|
-
/**
|
|
2867
|
-
* Emitted when lyrics for a track are not found.
|
|
2868
|
-
* The payload of the event will contain the track.
|
|
2869
|
-
* @param {Player} player - The player associated with the lyrics.
|
|
2870
|
-
* @param {Track} track - The track associated with the lyrics.
|
|
2871
|
-
* @param {LyricsNotFoundEvent} payload - The event payload containing additional data about the lyrics not found event.
|
|
2872
|
-
*/
|
|
2873
|
-
private lyricsNotFound;
|
|
2874
|
-
/**
|
|
2875
|
-
* Emitted when a line of lyrics for a track is received.
|
|
2876
|
-
* The payload of the event will contain the lyrics line.
|
|
2877
|
-
* @param {Player} player - The player associated with the lyrics line.
|
|
2878
|
-
* @param {Track} track - The track associated with the lyrics line.
|
|
2879
|
-
* @param {LyricsLineEvent} payload - The event payload containing additional data about the lyrics line event.
|
|
2880
|
-
*/
|
|
2881
|
-
private lyricsLine;
|
|
2882
|
-
/**
|
|
2883
|
-
* Fetches Lavalink node information.
|
|
2884
|
-
* @returns {Promise<LavalinkInfo>} A promise that resolves to the Lavalink node information.
|
|
2885
|
-
*/
|
|
2886
|
-
fetchInfo(): Promise<LavalinkInfo>;
|
|
2887
|
-
/**
|
|
2888
|
-
* Gets the current sponsorblock segments for a player.
|
|
2889
|
-
* @param {Player} player - The player to get the sponsorblocks for.
|
|
2890
|
-
* @returns {Promise<SponsorBlockSegment[]>} A promise that resolves to the sponsorblock segments.
|
|
2891
|
-
* @throws {RangeError} If the sponsorblock-plugin is not available in the Lavalink node.
|
|
2892
|
-
*/
|
|
2893
|
-
getSponsorBlock(player: Player): Promise<SponsorBlockSegment[]>;
|
|
2894
|
-
/**
|
|
2895
|
-
* Sets the sponsorblock segments for a player.
|
|
2896
|
-
* @param {Player} player - The player to set the sponsor blocks for.
|
|
2897
|
-
* @param {SponsorBlockSegment[]} segments - The sponsorblock segments to set. Defaults to `[SponsorBlockSegment.Sponsor, SponsorBlockSegment.SelfPromo]` if not provided.
|
|
2898
|
-
* @returns {Promise<void>} The promise is resolved when the operation is complete.
|
|
2899
|
-
* @throws {RangeError} If the sponsorblock-plugin is not available in the Lavalink node.
|
|
2900
|
-
* @throws {RangeError} If no segments are provided.
|
|
2901
|
-
* @throws {SyntaxError} If an invalid sponsorblock is provided.
|
|
2902
|
-
* @example
|
|
2903
|
-
* ```ts
|
|
2904
|
-
* // use it on the player via player.setSponsorBlock();
|
|
2905
|
-
* player.setSponsorBlock([SponsorBlockSegment.Sponsor, SponsorBlockSegment.SelfPromo]);
|
|
2906
|
-
* ```
|
|
2907
|
-
*/
|
|
2908
|
-
setSponsorBlock(player: Player, segments?: SponsorBlockSegment[]): Promise<void>;
|
|
2909
|
-
/**
|
|
2910
|
-
* Deletes the sponsorblock segments for a player.
|
|
2911
|
-
* @param {Player} player - The player to delete the sponsorblocks for.
|
|
2912
|
-
* @returns {Promise<void>} The promise is resolved when the operation is complete.
|
|
2913
|
-
* @throws {RangeError} If the sponsorblock-plugin is not available in the Lavalink node.
|
|
2914
|
-
*/
|
|
2915
|
-
deleteSponsorBlock(player: Player): Promise<void>;
|
|
2916
|
-
/**
|
|
2917
|
-
* Creates a README.md or README.txt file in the magmastream directory
|
|
2918
|
-
* if it doesn't already exist. This file is used to store player data
|
|
2919
|
-
* for autoresume and other features.
|
|
2920
|
-
* @private
|
|
2921
|
-
*/
|
|
2922
|
-
private createReadmeFile;
|
|
2923
|
-
}
|
|
2924
|
-
|
|
2925
|
-
/**
|
|
2926
|
-
* The main hub for interacting with Lavalink and using Magmastream.
|
|
2927
|
-
*/
|
|
2928
|
-
declare class Manager extends EventEmitter {
|
|
2929
|
-
/** The map of players. */
|
|
2930
|
-
readonly players: Collection<string, Player>;
|
|
2931
|
-
/** The map of nodes. */
|
|
2932
|
-
readonly nodes: Collection<string, Node>;
|
|
2933
|
-
/** The options that were set. */
|
|
2934
|
-
readonly options: ManagerOptions;
|
|
2935
|
-
initiated: boolean;
|
|
2936
|
-
redis?: Redis;
|
|
2937
|
-
private _send;
|
|
2938
|
-
private _getUser?;
|
|
2939
|
-
private _getGuild?;
|
|
2940
|
-
private loadedPlugins;
|
|
2941
|
-
/**
|
|
2942
|
-
* Initiates the Manager class.
|
|
2943
|
-
* @param options
|
|
2944
|
-
* @param options.enabledPlugins - An array of enabledPlugins to load.
|
|
2945
|
-
* @param options.nodes - An array of node options to create nodes from.
|
|
2946
|
-
* @param options.playNextOnEnd - Whether to automatically play the first track in the queue when the player is created.
|
|
2947
|
-
* @param options.autoPlaySearchPlatforms - The search platform autoplay will use. Fallback to Youtube if not found.
|
|
2948
|
-
* @param options.enablePriorityMode - Whether to use the priority when selecting a node to play on.
|
|
2949
|
-
* @param options.clientName - The name of the client to send to Lavalink.
|
|
2950
|
-
* @param options.defaultSearchPlatform - The default search platform to use when searching for tracks.
|
|
2951
|
-
* @param options.useNode - The strategy to use when selecting a node to play on.
|
|
2952
|
-
* @param options.trackPartial - The partial track search results to use when searching for tracks. This partials will always be presented on each track.
|
|
2953
|
-
* @param options.eventBatchDuration - The duration to wait before processing the collected player state events.
|
|
2954
|
-
* @param options.eventBatchInterval - The interval to wait before processing the collected player state events.
|
|
2955
|
-
*/
|
|
2956
|
-
constructor(options: ManagerOptions);
|
|
2957
|
-
/**
|
|
2958
|
-
* Initiates the Manager.
|
|
2959
|
-
* @param clientId - The Discord client ID (only required when not using any of the magmastream wrappers).
|
|
2960
|
-
* @param clusterId - The cluster ID which runs the current process (required).
|
|
2961
|
-
* @returns The manager instance.
|
|
2962
|
-
*/
|
|
2963
|
-
init(options?: ManagerInitOptions): Promise<this>;
|
|
2964
|
-
/**
|
|
2965
|
-
* Searches the enabled sources based off the URL or the `source` property.
|
|
2966
|
-
* @param query
|
|
2967
|
-
* @param requester
|
|
2968
|
-
* @returns The search result.
|
|
2969
|
-
*/
|
|
2970
|
-
search<T = unknown>(query: string | SearchQuery, requester?: T): Promise<SearchResult>;
|
|
2971
|
-
/**
|
|
2972
|
-
* Returns a player or undefined if it does not exist.
|
|
2973
|
-
* @param guildId The guild ID of the player to retrieve.
|
|
2974
|
-
* @returns The player if it exists, undefined otherwise.
|
|
2975
|
-
*/
|
|
2976
|
-
getPlayer(guildId: string): Player | undefined;
|
|
2977
|
-
/**
|
|
2978
|
-
* Creates a player or returns one if it already exists.
|
|
2979
|
-
* @param options The options to create the player with.
|
|
2980
|
-
* @returns The created player.
|
|
2981
|
-
*/
|
|
2982
|
-
create(options: PlayerOptions): Player;
|
|
2983
|
-
/**
|
|
2984
|
-
* Destroys a player.
|
|
2985
|
-
* @param guildId The guild ID of the player to destroy.
|
|
2986
|
-
* @returns A promise that resolves when the player has been destroyed.
|
|
2987
|
-
*/
|
|
2988
|
-
destroy(guildId: string): Promise<void>;
|
|
2989
|
-
/**
|
|
2990
|
-
* Creates a new node or returns an existing one if it already exists.
|
|
2991
|
-
* @param options - The options to create the node with.
|
|
2992
|
-
* @returns The created node.
|
|
2993
|
-
*/
|
|
2994
|
-
createNode(options: NodeOptions): Node;
|
|
2995
|
-
/**
|
|
2996
|
-
* Destroys a node if it exists. Emits a debug event if the node is found and destroyed.
|
|
2997
|
-
* @param identifier - The identifier of the node to destroy.
|
|
2998
|
-
* @returns {void}
|
|
2999
|
-
* @emits {debug} - Emits a debug message indicating the node is being destroyed.
|
|
3000
|
-
*/
|
|
3001
|
-
destroyNode(identifier: string): Promise<void>;
|
|
3002
|
-
/**
|
|
3003
|
-
* Attaches an event listener to the manager.
|
|
3004
|
-
* @param event The event to listen for.
|
|
3005
|
-
* @param listener The function to call when the event is emitted.
|
|
3006
|
-
* @returns The manager instance for chaining.
|
|
3007
|
-
*/
|
|
3008
|
-
on<T extends keyof ManagerEvents>(event: T, listener: (...args: ManagerEvents[T]) => void): this;
|
|
3009
|
-
/**
|
|
3010
|
-
* Updates the voice state of a player based on the provided data.
|
|
3011
|
-
* @param data - The data containing voice state information, which can be a VoicePacket, VoiceServer, or VoiceState.
|
|
3012
|
-
* @returns A promise that resolves when the voice state update is handled.
|
|
3013
|
-
* @emits {debug} - Emits a debug message indicating the voice state is being updated.
|
|
3014
|
-
*/
|
|
3015
|
-
updateVoiceState(data: VoicePacket | VoiceServer | VoiceState): Promise<void>;
|
|
3016
|
-
/**
|
|
3017
|
-
* Decodes an array of base64 encoded tracks and returns an array of TrackData.
|
|
3018
|
-
* Emits a debug event with the tracks being decoded.
|
|
3019
|
-
* @param tracks - An array of base64 encoded track strings.
|
|
3020
|
-
* @returns A promise that resolves to an array of TrackData objects.
|
|
3021
|
-
* @throws Will throw an error if no nodes are available or if the API request fails.
|
|
3022
|
-
*/
|
|
3023
|
-
decodeTracks(tracks: string[]): Promise<TrackData[]>;
|
|
3024
|
-
/**
|
|
3025
|
-
* Decodes a base64 encoded track and returns a TrackData.
|
|
3026
|
-
* @param track - The base64 encoded track string.
|
|
3027
|
-
* @returns A promise that resolves to a TrackData object.
|
|
3028
|
-
* @throws Will throw an error if no nodes are available or if the API request fails.
|
|
3029
|
-
*/
|
|
3030
|
-
decodeTrack(track: string): Promise<TrackData>;
|
|
3031
|
-
/**
|
|
3032
|
-
* Saves player states.
|
|
3033
|
-
* @param {string} guildId - The guild ID of the player to save
|
|
3034
|
-
*/
|
|
3035
|
-
savePlayerState(guildId: string): Promise<void>;
|
|
3036
|
-
/**
|
|
3037
|
-
* Sleeps for a specified amount of time.
|
|
3038
|
-
* @param ms The amount of time to sleep in milliseconds.
|
|
3039
|
-
* @returns A promise that resolves after the specified amount of time.
|
|
3040
|
-
*/
|
|
3041
|
-
private sleep;
|
|
3042
|
-
/**
|
|
3043
|
-
* Loads player states from the JSON file.
|
|
3044
|
-
* @param nodeId The ID of the node to load player states from.
|
|
3045
|
-
* @returns A promise that resolves when the player states have been loaded.
|
|
3046
|
-
*/
|
|
3047
|
-
loadPlayerStates(nodeId: string): Promise<void>;
|
|
3048
|
-
/**
|
|
3049
|
-
* Returns the node to use based on the configured `useNode` and `enablePriorityMode` options.
|
|
3050
|
-
* If `enablePriorityMode` is true, the node is chosen based on priority, otherwise it is chosen based on the `useNode` option.
|
|
3051
|
-
* If `useNode` is "leastLoad", the node with the lowest load is chosen, if it is "leastPlayers", the node with the fewest players is chosen.
|
|
3052
|
-
* If `enablePriorityMode` is false and `useNode` is not set, the node with the lowest load is chosen.
|
|
3053
|
-
* @returns {Node} The node to use.
|
|
3054
|
-
*/
|
|
3055
|
-
get useableNode(): Node;
|
|
3056
|
-
/**
|
|
3057
|
-
* Handles the shutdown of the process by saving all active players' states and optionally cleaning up inactive players.
|
|
3058
|
-
* This function is called when the process is about to exit.
|
|
3059
|
-
* It iterates through all players and calls {@link savePlayerState} to save their states.
|
|
3060
|
-
* Optionally, it also calls {@link cleanupInactivePlayers} to remove any stale player state files.
|
|
3061
|
-
* After saving and cleaning up, it exits the process.
|
|
3062
|
-
*/
|
|
3063
|
-
handleShutdown(): Promise<void>;
|
|
3064
|
-
/**
|
|
3065
|
-
* Parses a YouTube title into a clean title and author.
|
|
3066
|
-
* @param title - The original title of the YouTube video.
|
|
3067
|
-
* @param originalAuthor - The original author of the YouTube video.
|
|
3068
|
-
* @returns An object with the clean title and author.
|
|
3069
|
-
*/
|
|
3070
|
-
private parseYouTubeTitle;
|
|
3071
|
-
/**
|
|
3072
|
-
* Balances brackets in a given string by ensuring all opened brackets are closed correctly.
|
|
3073
|
-
* @param str - The input string that may contain unbalanced brackets.
|
|
3074
|
-
* @returns A new string with balanced brackets.
|
|
3075
|
-
*/
|
|
3076
|
-
private balanceBrackets;
|
|
3077
|
-
/**
|
|
3078
|
-
* Escapes a string by replacing special regex characters with their escaped counterparts.
|
|
3079
|
-
* @param string - The string to escape.
|
|
3080
|
-
* @returns The escaped string.
|
|
3081
|
-
*/
|
|
3082
|
-
private escapeRegExp;
|
|
3083
|
-
/**
|
|
3084
|
-
* Checks if the given data is a voice update.
|
|
3085
|
-
* @param data The data to check.
|
|
3086
|
-
* @returns Whether the data is a voice update.
|
|
3087
|
-
*/
|
|
3088
|
-
private isVoiceUpdate;
|
|
3089
|
-
/**
|
|
3090
|
-
* Determines if the provided update is a valid voice update.
|
|
3091
|
-
* A valid update must contain either a token or a session_id.
|
|
3092
|
-
*
|
|
3093
|
-
* @param update - The voice update data to validate, which can be a VoicePacket, VoiceServer, or VoiceState.
|
|
3094
|
-
* @returns {boolean} - True if the update is valid, otherwise false.
|
|
3095
|
-
*/
|
|
3096
|
-
private isValidUpdate;
|
|
3097
|
-
/**
|
|
3098
|
-
* Handles a voice server update by updating the player's voice state and sending the voice state to the Lavalink node.
|
|
3099
|
-
* @param player The player for which the voice state is being updated.
|
|
3100
|
-
* @param update The voice server data received from Discord.
|
|
3101
|
-
* @returns A promise that resolves when the voice state update is handled.
|
|
3102
|
-
* @emits {debug} - Emits a debug message indicating the voice state is being updated.
|
|
3103
|
-
*/
|
|
3104
|
-
private handleVoiceServerUpdate;
|
|
3105
|
-
/**
|
|
3106
|
-
* Handles a voice state update by updating the player's voice channel and session ID if provided, or by disconnecting and destroying the player if the channel ID is null.
|
|
3107
|
-
* @param player The player for which the voice state is being updated.
|
|
3108
|
-
* @param update The voice state data received from Discord.
|
|
3109
|
-
* @emits {playerMove} - Emits a player move event if the channel ID is provided and the player is currently connected to a different voice channel.
|
|
3110
|
-
* @emits {playerDisconnect} - Emits a player disconnect event if the channel ID is null.
|
|
3111
|
-
*/
|
|
3112
|
-
private handleVoiceStateUpdate;
|
|
3113
|
-
/**
|
|
3114
|
-
* Cleans up an inactive player by removing its state data.
|
|
3115
|
-
* This is done to prevent stale state data from accumulating.
|
|
3116
|
-
* @param guildId The guild ID of the player to clean up.
|
|
3117
|
-
*/
|
|
3118
|
-
cleanupInactivePlayer(guildId: string): Promise<void>;
|
|
3119
|
-
/**
|
|
3120
|
-
* Loads the enabled plugins.
|
|
3121
|
-
*/
|
|
3122
|
-
private loadPlugins;
|
|
3123
|
-
/**
|
|
3124
|
-
* Unloads the enabled plugins.
|
|
3125
|
-
*/
|
|
3126
|
-
private unloadPlugins;
|
|
3127
|
-
/**
|
|
3128
|
-
* Clears all player states from the file system.
|
|
3129
|
-
* This is done to prevent stale state files from accumulating on the file system.
|
|
3130
|
-
*/
|
|
3131
|
-
private clearAllStoredPlayers;
|
|
3132
|
-
/**
|
|
3133
|
-
* Returns the nodes that has the least load.
|
|
3134
|
-
* The load is calculated by dividing the lavalink load by the number of cores.
|
|
3135
|
-
* The result is multiplied by 100 to get a percentage.
|
|
3136
|
-
* @returns {Collection<string, Node>}
|
|
3137
|
-
*/
|
|
3138
|
-
private get leastLoadNode();
|
|
3139
|
-
/**
|
|
3140
|
-
* Returns the nodes that have the least amount of players.
|
|
3141
|
-
* Filters out disconnected nodes and sorts the remaining nodes
|
|
3142
|
-
* by the number of players in ascending order.
|
|
3143
|
-
* @returns {Collection<string, Node>} A collection of nodes sorted by player count.
|
|
3144
|
-
*/
|
|
3145
|
-
private get leastPlayersNode();
|
|
3146
|
-
/**
|
|
3147
|
-
* Returns a node based on priority.
|
|
3148
|
-
* The nodes are sorted by priority in descending order, and then a random number
|
|
3149
|
-
* between 0 and 1 is generated. The node that has a cumulative weight greater than or equal to the
|
|
3150
|
-
* random number is returned.
|
|
3151
|
-
* If no node has a cumulative weight greater than or equal to the random number, the node with the
|
|
3152
|
-
* lowest load is returned.
|
|
3153
|
-
* @returns {Node} The node to use.
|
|
3154
|
-
*/
|
|
3155
|
-
private get priorityNode();
|
|
3156
|
-
protected send(packet: GatewayVoiceStateUpdate): unknown;
|
|
3157
|
-
protected getUserFromCache(id: string): AnyUser | undefined;
|
|
3158
|
-
protected getGuildFromCache(id: string): AnyGuild | undefined;
|
|
3159
|
-
sendPacket(packet: GatewayVoiceStateUpdate): unknown;
|
|
3160
|
-
/**
|
|
3161
|
-
* Resolves a PortableUser or ID to a real user object.
|
|
3162
|
-
* Can be overridden by wrapper managers to return wrapper-specific User classes.
|
|
3163
|
-
*/
|
|
3164
|
-
resolveUser(user: AnyUser | string): Promise<AnyUser>;
|
|
3165
|
-
/**
|
|
3166
|
-
* Resolves a Guild ID to a real guild object.
|
|
3167
|
-
* Can be overridden by wrapper managers to return wrapper-specific Guild classes.
|
|
3168
|
-
*/
|
|
3169
|
-
resolveGuild(guildId: string): AnyGuild;
|
|
3170
|
-
}
|
|
3171
|
-
|
|
3172
|
-
declare class Filters {
|
|
3173
|
-
distortion: DistortionOptions | null;
|
|
3174
|
-
equalizer: Band[];
|
|
3175
|
-
karaoke: KaraokeOptions | null;
|
|
3176
|
-
rotation: RotationOptions | null;
|
|
3177
|
-
timescale: TimescaleOptions | null;
|
|
3178
|
-
vibrato: VibratoOptions | null;
|
|
3179
|
-
reverb: ReverbOptions | null;
|
|
3180
|
-
volume: number;
|
|
3181
|
-
bassBoostlevel: number;
|
|
3182
|
-
filtersStatus: Record<AvailableFilters, boolean>;
|
|
3183
|
-
manager: Manager;
|
|
3184
|
-
player: Player;
|
|
3185
|
-
constructor(player: Player, manager: Manager);
|
|
3186
|
-
/**
|
|
3187
|
-
* Updates the player's audio filters.
|
|
3188
|
-
*
|
|
3189
|
-
* This method sends a request to the player's node to update the filter settings
|
|
3190
|
-
* based on the current properties of the `Filters` instance. The filters include
|
|
3191
|
-
* distortion, equalizer, karaoke, rotation, timescale, vibrato, and volume. Once
|
|
3192
|
-
* the request is sent, it ensures that the player's audio output reflects the
|
|
3193
|
-
* changes in filter settings.
|
|
3194
|
-
*
|
|
3195
|
-
* @returns {Promise<this>} - Returns a promise that resolves to the current instance
|
|
3196
|
-
* of the Filters class for method chaining.
|
|
3197
|
-
*/
|
|
3198
|
-
updateFilters(): Promise<this>;
|
|
3199
|
-
/**
|
|
3200
|
-
* Applies a specific filter to the player.
|
|
3201
|
-
*
|
|
3202
|
-
* This method allows you to set the value of a specific filter property.
|
|
3203
|
-
* The filter property must be a valid key of the Filters object.
|
|
3204
|
-
*
|
|
3205
|
-
* @param {{ property: T; value: Filters[T] }} filter - An object containing the filter property and value.
|
|
3206
|
-
* @param {boolean} [updateFilters=true] - Whether to update the filters after applying the filter.
|
|
3207
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3208
|
-
*/
|
|
3209
|
-
private applyFilter;
|
|
3210
|
-
private emitPlayersTasteUpdate;
|
|
3211
|
-
/**
|
|
3212
|
-
* Sets the status of a specific filter.
|
|
3213
|
-
*
|
|
3214
|
-
* This method updates the filter status to either true or false, indicating whether
|
|
3215
|
-
* the filter is applied or not. This helps track which filters are active.
|
|
3216
|
-
*
|
|
3217
|
-
* @param {AvailableFilters} filter - The filter to update.
|
|
3218
|
-
* @param {boolean} status - The status to set (true for active, false for inactive).
|
|
3219
|
-
* @returns {this} - Returns the current instance of the Filters class for method chaining.
|
|
3220
|
-
*/
|
|
3221
|
-
private setFilterStatus;
|
|
3222
|
-
/**
|
|
3223
|
-
* Retrieves the status of a specific filter.
|
|
3224
|
-
*
|
|
3225
|
-
* This method returns whether a specific filter is currently applied or not.
|
|
3226
|
-
*
|
|
3227
|
-
* @param {AvailableFilters} filter - The filter to check.
|
|
3228
|
-
* @returns {boolean} - Returns true if the filter is active, false otherwise.
|
|
3229
|
-
*/
|
|
3230
|
-
getFilterStatus(filter: AvailableFilters): boolean;
|
|
3231
|
-
/**
|
|
3232
|
-
* Clears all filters applied to the audio.
|
|
3233
|
-
*
|
|
3234
|
-
* This method resets all filter settings to their default values and removes any
|
|
3235
|
-
* active filters from the player.
|
|
3236
|
-
*
|
|
3237
|
-
* @returns {this} - Returns the current instance of the Filters class for method chaining.
|
|
3238
|
-
*/
|
|
3239
|
-
clearFilters(): Promise<this>;
|
|
3240
|
-
/**
|
|
3241
|
-
* Sets the own equalizer bands on the audio.
|
|
3242
|
-
*
|
|
3243
|
-
* This method adjusts the equalization curve of the player's audio output,
|
|
3244
|
-
* allowing you to control the frequency response.
|
|
3245
|
-
*
|
|
3246
|
-
* @param {Band[]} [bands] - The equalizer bands to apply (band, gain).
|
|
3247
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3248
|
-
*/
|
|
3249
|
-
setEqualizer(bands?: Band[]): Promise<this>;
|
|
3250
|
-
/**
|
|
3251
|
-
* Sets the own karaoke options to the audio.
|
|
3252
|
-
*
|
|
3253
|
-
* This method adjusts the audio so that it sounds like a karaoke song, with the
|
|
3254
|
-
* original vocals removed. Note that not all songs can be successfully made into
|
|
3255
|
-
* karaoke tracks, and some tracks may not sound as good.
|
|
3256
|
-
*
|
|
3257
|
-
* @param {KaraokeOptions} [karaoke] - The karaoke settings to apply (level, monoLevel, filterBand, filterWidth).
|
|
3258
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3259
|
-
*/
|
|
3260
|
-
setKaraoke(karaoke?: KaraokeOptions): Promise<this>;
|
|
3261
|
-
/**
|
|
3262
|
-
* Sets the own timescale options to the audio.
|
|
3263
|
-
*
|
|
3264
|
-
* This method adjusts the speed and pitch of the audio, allowing you to control the playback speed.
|
|
3265
|
-
*
|
|
3266
|
-
* @param {TimescaleOptions} [timescale] - The timescale settings to apply (speed and pitch).
|
|
3267
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3268
|
-
*/
|
|
3269
|
-
setTimescale(timescale?: TimescaleOptions): Promise<this>;
|
|
3270
|
-
/**
|
|
3271
|
-
* Sets the own vibrato options to the audio.
|
|
3272
|
-
*
|
|
3273
|
-
* This method applies a vibrato effect to the audio, which adds a wavering,
|
|
3274
|
-
* pulsing quality to the sound. The effect is created by rapidly varying the
|
|
3275
|
-
* pitch of the audio.
|
|
3276
|
-
*
|
|
3277
|
-
* @param {VibratoOptions} [vibrato] - The vibrato settings to apply (frequency, depth).
|
|
3278
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3279
|
-
*/
|
|
3280
|
-
setVibrato(vibrato?: VibratoOptions): Promise<this>;
|
|
3281
|
-
/**
|
|
3282
|
-
* Sets the own rotation options effect to the audio.
|
|
3283
|
-
*
|
|
3284
|
-
* This method applies a rotation effect to the audio, which simulates the sound
|
|
3285
|
-
* moving around the listener's head. This effect can create a dynamic and immersive
|
|
3286
|
-
* audio experience by altering the directionality of the sound.
|
|
3287
|
-
*
|
|
3288
|
-
* @param {RotationOptions} [rotation] - The rotation settings to apply (rotationHz).
|
|
3289
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3290
|
-
*/
|
|
3291
|
-
setRotation(rotation?: RotationOptions): Promise<this>;
|
|
3292
|
-
/**
|
|
3293
|
-
* Sets the own distortion options effect to the audio.
|
|
3294
|
-
*
|
|
3295
|
-
* This method applies a distortion effect to the audio, which adds a rougher,
|
|
3296
|
-
* more intense quality to the sound. The effect is created by altering the
|
|
3297
|
-
* audio signal to create a more jagged, irregular waveform.
|
|
3298
|
-
*
|
|
3299
|
-
* @param {DistortionOptions} [distortion] - The distortion settings to apply (sinOffset, sinScale, cosOffset, cosScale, tanOffset, tanScale, offset, scale).
|
|
3300
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3301
|
-
*/
|
|
3302
|
-
setDistortion(distortion?: DistortionOptions): Promise<this>;
|
|
3303
|
-
/**
|
|
3304
|
-
* Sets the bass boost level on the audio.
|
|
3305
|
-
*
|
|
3306
|
-
* This method scales the gain of a predefined equalizer curve to the specified level.
|
|
3307
|
-
* The curve is designed to emphasize or reduce low frequencies, creating a bass-heavy
|
|
3308
|
-
* or bass-reduced effect.
|
|
3309
|
-
*
|
|
3310
|
-
* @param {number} level - The level of bass boost to apply. The value ranges from -3 to 3,
|
|
3311
|
-
* where negative values reduce bass, 0 disables the effect,
|
|
3312
|
-
* and positive values increase bass.
|
|
3313
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3314
|
-
*
|
|
3315
|
-
* @example
|
|
3316
|
-
* // Apply different levels of bass boost or reduction:
|
|
3317
|
-
* await player.bassBoost(3); // Maximum Bass Boost
|
|
3318
|
-
* await player.bassBoost(2); // Medium Bass Boost
|
|
3319
|
-
* await player.bassBoost(1); // Mild Bass Boost
|
|
3320
|
-
* await player.bassBoost(0); // No Effect (Disabled)
|
|
3321
|
-
* await player.bassBoost(-1); // Mild Bass Reduction
|
|
3322
|
-
* await player.bassBoost(-2); // Medium Bass Reduction
|
|
3323
|
-
* await player.bassBoost(-3); // Maximum Bass Removal
|
|
3324
|
-
*/
|
|
3325
|
-
bassBoost(stage: number): Promise<this>;
|
|
3326
|
-
/**
|
|
3327
|
-
* Toggles the chipmunk effect on the audio.
|
|
3328
|
-
*
|
|
3329
|
-
* This method applies or removes a chipmunk effect by adjusting the timescale settings.
|
|
3330
|
-
* When enabled, it increases the speed, pitch, and rate of the audio, resulting in a high-pitched, fast playback
|
|
3331
|
-
* similar to the sound of a chipmunk.
|
|
3332
|
-
*
|
|
3333
|
-
* @param {boolean} status - Whether to enable or disable the chipmunk effect.
|
|
3334
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3335
|
-
*/
|
|
3336
|
-
chipmunk(status: boolean): Promise<this>;
|
|
3337
|
-
/**
|
|
3338
|
-
* Toggles the "China" effect on the audio.
|
|
3339
|
-
*
|
|
3340
|
-
* This method applies or removes a filter that reduces the pitch of the audio by half,
|
|
3341
|
-
* without changing the speed or rate. This creates a "hollow" or "echoey" sound.
|
|
3342
|
-
*
|
|
3343
|
-
* @param {boolean} status - Whether to enable or disable the "China" effect.
|
|
3344
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3345
|
-
*/
|
|
3346
|
-
china(status: boolean): Promise<this>;
|
|
3347
|
-
/**
|
|
3348
|
-
* Toggles the 8D audio effect on the audio.
|
|
3349
|
-
*
|
|
3350
|
-
* This method applies or removes an 8D audio effect by adjusting the rotation settings.
|
|
3351
|
-
* When enabled, it creates a sensation of the audio moving around the listener's head,
|
|
3352
|
-
* providing an immersive audio experience.
|
|
3353
|
-
*
|
|
3354
|
-
* @param {boolean} status - Whether to enable or disable the 8D effect.
|
|
3355
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3356
|
-
*/
|
|
3357
|
-
eightD(status: boolean): Promise<this>;
|
|
3358
|
-
/**
|
|
3359
|
-
* Toggles the nightcore effect on the audio.
|
|
3360
|
-
*
|
|
3361
|
-
* This method applies or removes a nightcore effect by adjusting the timescale settings.
|
|
3362
|
-
* When enabled, it increases the speed and pitch of the audio, giving it a more
|
|
3363
|
-
* upbeat and energetic feel.
|
|
3364
|
-
*
|
|
3365
|
-
* @param {boolean} status - Whether to enable or disable the nightcore effect.
|
|
3366
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3367
|
-
*/
|
|
3368
|
-
nightcore(status: boolean): Promise<this>;
|
|
3369
|
-
/**
|
|
3370
|
-
* Toggles the slowmo effect on the audio.
|
|
3371
|
-
*
|
|
3372
|
-
* This method applies or removes a slowmo effect by adjusting the timescale settings.
|
|
3373
|
-
* When enabled, it slows down the audio while keeping the pitch the same, giving it
|
|
3374
|
-
* a more relaxed and calming feel.
|
|
3375
|
-
*
|
|
3376
|
-
* @param {boolean} status - Whether to enable or disable the slowmo effect.
|
|
3377
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3378
|
-
*/
|
|
3379
|
-
slowmo(status: boolean): Promise<this>;
|
|
3380
|
-
/**
|
|
3381
|
-
* Toggles a soft equalizer effect to the audio.
|
|
3382
|
-
*
|
|
3383
|
-
* This method applies or removes a soft equalizer effect by adjusting the equalizer settings.
|
|
3384
|
-
* When enabled, it reduces the bass and treble frequencies, giving the audio a softer and more
|
|
3385
|
-
* mellow sound.
|
|
3386
|
-
*
|
|
3387
|
-
* @param {boolean} status - Whether to enable or disable the soft equalizer effect.
|
|
3388
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3389
|
-
*/
|
|
3390
|
-
soft(status: boolean): Promise<this>;
|
|
3391
|
-
/**
|
|
3392
|
-
* Toggles the TV equalizer effect on the audio.
|
|
3393
|
-
*
|
|
3394
|
-
* This method applies or removes a TV equalizer effect by adjusting the equalizer settings.
|
|
3395
|
-
* When enabled, it enhances specific frequency bands to mimic the audio characteristics
|
|
3396
|
-
* typically found in television audio outputs.
|
|
3397
|
-
*
|
|
3398
|
-
* @param {boolean} status - Whether to enable or disable the TV equalizer effect.
|
|
3399
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3400
|
-
*/
|
|
3401
|
-
tv(status: boolean): Promise<this>;
|
|
3402
|
-
/**
|
|
3403
|
-
* Toggles the treble/bass equalizer effect on the audio.
|
|
3404
|
-
*
|
|
3405
|
-
* This method applies or removes a treble/bass equalizer effect by adjusting the equalizer settings.
|
|
3406
|
-
* When enabled, it enhances the treble and bass frequencies, giving the audio a more balanced sound.
|
|
3407
|
-
*
|
|
3408
|
-
* @param {boolean} status - Whether to enable or disable the treble/bass equalizer effect.
|
|
3409
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3410
|
-
*/
|
|
3411
|
-
trebleBass(status: boolean): Promise<this>;
|
|
3412
|
-
/**
|
|
3413
|
-
* Toggles the vaporwave effect on the audio.
|
|
3414
|
-
*
|
|
3415
|
-
* This method applies or removes a vaporwave effect by adjusting the equalizer settings.
|
|
3416
|
-
* When enabled, it gives the audio a dreamy and nostalgic feel, characteristic of the vaporwave genre.
|
|
3417
|
-
*
|
|
3418
|
-
* @param {boolean} status - Whether to enable or disable the vaporwave effect.
|
|
3419
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3420
|
-
*/
|
|
3421
|
-
vaporwave(status: boolean): Promise<this>;
|
|
3422
|
-
/**
|
|
3423
|
-
* Toggles the distortion effect on the audio.
|
|
3424
|
-
*
|
|
3425
|
-
* This method applies or removes a distortion effect by adjusting the distortion settings.
|
|
3426
|
-
* When enabled, it adds a rougher, more intense quality to the sound by altering the
|
|
3427
|
-
* audio signal to create a more jagged, irregular waveform.
|
|
3428
|
-
*
|
|
3429
|
-
* @param {boolean} status - Whether to enable or disable the distortion effect.
|
|
3430
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3431
|
-
*/
|
|
3432
|
-
distort(status: boolean): Promise<this>;
|
|
3433
|
-
/**
|
|
3434
|
-
* Toggles the party effect on the audio.
|
|
3435
|
-
*
|
|
3436
|
-
* This method applies or removes a party effect by adjusting the equalizer settings.
|
|
3437
|
-
* When enabled, it enhances the bass and treble frequencies, providing a more energetic and lively sound.
|
|
3438
|
-
*
|
|
3439
|
-
* @param {boolean} status - Whether to enable or disable the party effect.
|
|
3440
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3441
|
-
*/
|
|
3442
|
-
pop(status: boolean): Promise<this>;
|
|
3443
|
-
/**
|
|
3444
|
-
* Toggles a party effect on the audio.
|
|
3445
|
-
*
|
|
3446
|
-
* This method applies a party effect to audio.
|
|
3447
|
-
* @param {boolean} status - Whether to enable or disable the party effect.
|
|
3448
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3449
|
-
*/
|
|
3450
|
-
party(status: boolean): Promise<this>;
|
|
3451
|
-
/**
|
|
3452
|
-
* Toggles earrape effect on the audio.
|
|
3453
|
-
*
|
|
3454
|
-
* This method applies earrape effect to audio.
|
|
3455
|
-
* @param {boolean} status - Whether to enable or disable the earrape effect.
|
|
3456
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3457
|
-
*/
|
|
3458
|
-
earrape(status: boolean): Promise<this>;
|
|
3459
|
-
/**
|
|
3460
|
-
* Toggles electronic effect on the audio.
|
|
3461
|
-
*
|
|
3462
|
-
* This method applies electronic effect to audio.
|
|
3463
|
-
* @param {boolean} status - Whether to enable or disable the electronic effect.
|
|
3464
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3465
|
-
*/
|
|
3466
|
-
electronic(status: boolean): Promise<this>;
|
|
3467
|
-
/**
|
|
3468
|
-
* Toggles radio effect on the audio.
|
|
3469
|
-
*
|
|
3470
|
-
* This method applies radio effect to audio.
|
|
3471
|
-
* @param {boolean} status - Whether to enable or disable the radio effect.
|
|
3472
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3473
|
-
*/
|
|
3474
|
-
radio(status: boolean): Promise<this>;
|
|
3475
|
-
/**
|
|
3476
|
-
* Toggles a tremolo effect on the audio.
|
|
3477
|
-
*
|
|
3478
|
-
* This method applies a tremolo effect to audio.
|
|
3479
|
-
* @param {boolean} status - Whether to enable or disable the tremolo effect.
|
|
3480
|
-
* @returns {this} - Returns the current instance of the Filters class for method chaining.
|
|
3481
|
-
*/
|
|
3482
|
-
tremolo(status: boolean): Promise<this>;
|
|
3483
|
-
/**
|
|
3484
|
-
* Toggless a darthvader effect on the audio.
|
|
3485
|
-
*
|
|
3486
|
-
* This method applies a darthvader effect to audio.
|
|
3487
|
-
* @param {boolean} status - Whether to enable or disable the darthvader effect.
|
|
3488
|
-
* @returns {this} - Returns the current instance of the Filters class for method chaining.
|
|
3489
|
-
*/
|
|
3490
|
-
darthvader(status: boolean): Promise<this>;
|
|
3491
|
-
/**
|
|
3492
|
-
* Toggles a daycore effect on the audio.
|
|
3493
|
-
*
|
|
3494
|
-
* This method applies a daycore effect to audio.
|
|
3495
|
-
* @param {boolean} status - Whether to enable or disable the daycore effect.
|
|
3496
|
-
* @returns {this} - Returns the current instance of the Filters class for method chaining.
|
|
3497
|
-
*/
|
|
3498
|
-
daycore(status: boolean): Promise<this>;
|
|
3499
|
-
/**
|
|
3500
|
-
* Toggles a doubletime effect on the audio.
|
|
3501
|
-
*
|
|
3502
|
-
* This method applies a doubletime effect to audio.
|
|
3503
|
-
* @param {boolean} status - Whether to enable or disable the doubletime effect.
|
|
3504
|
-
* @returns {this} - Returns the current instance of the Filters class for method chaining
|
|
3505
|
-
*/
|
|
3506
|
-
doubletime(status: boolean): Promise<this>;
|
|
3507
|
-
/**
|
|
3508
|
-
* Toggles the demon effect on the audio.
|
|
3509
|
-
*
|
|
3510
|
-
* This method applies or removes a demon effect by adjusting the equalizer,
|
|
3511
|
-
* timescale, and reverb settings. When enabled, it creates a deeper and more
|
|
3512
|
-
* intense sound by lowering the pitch and adding reverb to the audio.
|
|
3513
|
-
*
|
|
3514
|
-
* @param {boolean} status - Whether to enable or disable the demon effect.
|
|
3515
|
-
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
3516
|
-
*/
|
|
3517
|
-
demon(status: boolean): Promise<this>;
|
|
3518
|
-
}
|
|
3519
|
-
|
|
3520
|
-
declare abstract class TrackUtils {
|
|
3521
|
-
static trackPartial: TrackPartial[] | null;
|
|
3522
|
-
private static manager;
|
|
3523
|
-
/**
|
|
3524
|
-
* Initializes the TrackUtils class with the given manager.
|
|
3525
|
-
* @param manager The manager instance to use.
|
|
3526
|
-
* @hidden
|
|
3527
|
-
*/
|
|
3528
|
-
static init(manager: Manager): void;
|
|
3529
|
-
/**
|
|
3530
|
-
* Sets the partial properties for the Track class. If a Track has some of its properties removed by the partial,
|
|
3531
|
-
* it will be considered a partial Track.
|
|
3532
|
-
* @param {TrackPartial} partial The array of string property names to remove from the Track class.
|
|
3533
|
-
*/
|
|
3534
|
-
static setTrackPartial(partial: TrackPartial[]): void;
|
|
3535
|
-
/**
|
|
3536
|
-
* Checks if the provided argument is a valid Track.
|
|
3537
|
-
* @param value The value to check.
|
|
3538
|
-
* @returns {boolean} Whether the provided argument is a valid Track.
|
|
3539
|
-
*/
|
|
3540
|
-
static isTrack(track: unknown): track is Track;
|
|
3541
|
-
/**
|
|
3542
|
-
* Checks if the provided argument is a valid Track array.
|
|
3543
|
-
* @param value The value to check.
|
|
3544
|
-
* @returns {boolean} Whether the provided argument is a valid Track array.
|
|
3545
|
-
*/
|
|
3546
|
-
static isTrackArray(value: unknown): value is Track[];
|
|
3547
|
-
/**
|
|
3548
|
-
* Checks if the provided argument is a valid Track or Track array.
|
|
3549
|
-
* @param value The value to check.
|
|
3550
|
-
* @returns {boolean} Whether the provided argument is a valid Track or Track array.
|
|
3551
|
-
*/
|
|
3552
|
-
static validate(value: unknown): value is Track | Track[];
|
|
3553
|
-
/**
|
|
3554
|
-
* Builds a Track from the raw data from Lavalink and a optional requester.
|
|
3555
|
-
* @param data The raw data from Lavalink to build the Track from.
|
|
3556
|
-
* @param requester The user who requested the track, if any.
|
|
3557
|
-
* @param isAutoPlay Whether the track is autoplayed. Defaults to false.
|
|
3558
|
-
* @returns The built Track.
|
|
3559
|
-
*/
|
|
3560
|
-
static build<T = AnyUser>(data: TrackData, requester?: T, isAutoplay?: boolean): Track;
|
|
3561
|
-
/**
|
|
3562
|
-
* Validates a search result.
|
|
3563
|
-
* @param result The search result to validate.
|
|
3564
|
-
* @returns Whether the search result is valid.
|
|
3565
|
-
*/
|
|
3566
|
-
static isErrorOrEmptySearchResult(result: SearchResult): result is ErrorOrEmptySearchResult;
|
|
3567
|
-
/**
|
|
3568
|
-
* Revives a track.
|
|
3569
|
-
* @param track The track to revive.
|
|
3570
|
-
* @returns The revived track.
|
|
3571
|
-
*/
|
|
3572
|
-
static revive(track: Track): Track;
|
|
3573
|
-
}
|
|
3574
|
-
declare abstract class AutoPlayUtils {
|
|
3575
|
-
private static manager;
|
|
3576
|
-
/**
|
|
3577
|
-
* Initializes the AutoPlayUtils class with the given manager.
|
|
3578
|
-
* @param manager The manager instance to use.
|
|
3579
|
-
* @hidden
|
|
3580
|
-
*/
|
|
3581
|
-
static init(manager: Manager): Promise<void>;
|
|
3582
|
-
/**
|
|
3583
|
-
* Gets recommended tracks for the given track.
|
|
3584
|
-
* @param track The track to get recommended tracks for.
|
|
3585
|
-
* @returns An array of recommended tracks.
|
|
3586
|
-
*/
|
|
3587
|
-
static getRecommendedTracks(track: Track): Promise<Track[]>;
|
|
3588
|
-
/**
|
|
3589
|
-
* Gets recommended tracks from Last.fm for the given track.
|
|
3590
|
-
* @param track The track to get recommended tracks for.
|
|
3591
|
-
* @param apiKey The API key for Last.fm.
|
|
3592
|
-
* @returns An array of recommended tracks.
|
|
3593
|
-
*/
|
|
3594
|
-
static getRecommendedTracksFromLastFm(track: Track, apiKey: string): Promise<Track[]>;
|
|
3595
|
-
/**
|
|
3596
|
-
* Gets recommended tracks from the given source.
|
|
3597
|
-
* @param track The track to get recommended tracks for.
|
|
3598
|
-
* @param platform The source to get recommended tracks from.
|
|
3599
|
-
* @returns An array of recommended tracks.
|
|
3600
|
-
*/
|
|
3601
|
-
static getRecommendedTracksFromSource(track: Track, platform: AutoPlayPlatform): Promise<Track[]>;
|
|
3602
|
-
/**
|
|
3603
|
-
* Searches for a track using the manager and returns resolved tracks.
|
|
3604
|
-
* @param query The search query (artist - title).
|
|
3605
|
-
* @param requester The requester who initiated the search.
|
|
3606
|
-
* @returns An array of resolved tracks, or an empty array if not found or error occurred.
|
|
3607
|
-
*/
|
|
3608
|
-
private static resolveTracksFromQuery;
|
|
3609
|
-
/**
|
|
3610
|
-
* Resolves the first available track from a search query using the specified source.
|
|
3611
|
-
* Useful for normalizing tracks that lack platform-specific metadata or URIs.
|
|
3612
|
-
*
|
|
3613
|
-
* @param query - The search query string (usually "Artist - Title").
|
|
3614
|
-
* @param source - The search platform to use (e.g., Spotify, Deezer, YouTube).
|
|
3615
|
-
* @param requester - The requester object, used for context or attribution.
|
|
3616
|
-
* @returns A single resolved {@link Track} object if found, or `null` if the search fails or returns no results.
|
|
3617
|
-
*/
|
|
3618
|
-
private static resolveFirstTrackFromQuery;
|
|
3619
|
-
private static isPlaylistRawData;
|
|
3620
|
-
private static isTrackData;
|
|
3621
|
-
private static isTrackDataArray;
|
|
3622
|
-
static buildTracksFromResponse<T>(recommendedResult: LavalinkResponse, requester?: T): Track[];
|
|
3623
|
-
}
|
|
3624
|
-
declare abstract class PlayerUtils {
|
|
3625
|
-
private static manager;
|
|
3626
|
-
/**
|
|
3627
|
-
* Initializes the PlayerUtils class with the given manager.
|
|
3628
|
-
* @param manager The manager instance to use.
|
|
3629
|
-
* @hidden
|
|
3630
|
-
*/
|
|
3631
|
-
static init(manager: Manager): void;
|
|
3632
|
-
/**
|
|
3633
|
-
* Serializes a Player instance to avoid circular references.
|
|
3634
|
-
* @param player The Player instance to serialize
|
|
3635
|
-
* @returns The serialized Player instance
|
|
3636
|
-
*/
|
|
3637
|
-
static serializePlayer(player: Player): Promise<Record<string, unknown> | null>;
|
|
3638
|
-
/**
|
|
3639
|
-
* Gets the base directory for player data.
|
|
3640
|
-
*/
|
|
3641
|
-
static getPlayersBaseDir(): string;
|
|
3642
|
-
/**
|
|
3643
|
-
* Gets the path to the player's directory.
|
|
3644
|
-
*/
|
|
3645
|
-
static getGuildDir(guildId: string): string;
|
|
3646
|
-
/**
|
|
3647
|
-
* Gets the path to the player's state file.
|
|
3648
|
-
*/
|
|
3649
|
-
static getPlayerStatePath(guildId: string): string;
|
|
3650
|
-
/**
|
|
3651
|
-
* Gets the path to the player's current track file.
|
|
3652
|
-
*/
|
|
3653
|
-
static getPlayerCurrentPath(guildId: string): string;
|
|
3654
|
-
/**
|
|
3655
|
-
* Gets the path to the player's queue file.
|
|
3656
|
-
*/
|
|
3657
|
-
static getPlayerQueuePath(guildId: string): string;
|
|
3658
|
-
/**
|
|
3659
|
-
* Gets the path to the player's previous tracks file.
|
|
3660
|
-
*/
|
|
3661
|
-
static getPlayerPreviousPath(guildId: string): string;
|
|
3662
|
-
/**
|
|
3663
|
-
* Gets the Redis key for player storage.
|
|
3664
|
-
*/
|
|
3665
|
-
static getRedisKey(): string;
|
|
3666
|
-
}
|
|
3667
|
-
/** Gets or extends structures to extend the built in, or already extended, classes to add more functionality. */
|
|
3668
|
-
declare abstract class Structure {
|
|
3669
|
-
/**
|
|
3670
|
-
* Extends a class.
|
|
3671
|
-
* @param name
|
|
3672
|
-
* @param extender
|
|
3673
|
-
*/
|
|
3674
|
-
static extend<K extends keyof Extendable, T extends Extendable[K]>(name: K, extender: (target: Extendable[K]) => T): T;
|
|
3675
|
-
/**
|
|
3676
|
-
* Get a structure from available structures by name.
|
|
3677
|
-
* @param name
|
|
3678
|
-
*/
|
|
3679
|
-
static get<K extends keyof Extendable>(name: K): Extendable[K];
|
|
3680
|
-
}
|
|
3681
|
-
declare abstract class JSONUtils {
|
|
3682
|
-
static safe<T>(obj: T, space?: number): string;
|
|
3683
|
-
static serializeTrack(track: Track): string;
|
|
3684
|
-
}
|
|
3685
|
-
|
|
3686
|
-
interface MagmaStreamErrorOptions<T = unknown> {
|
|
3687
|
-
code: MagmaStreamErrorCode;
|
|
3688
|
-
message?: string;
|
|
3689
|
-
cause?: Error;
|
|
3690
|
-
context?: T;
|
|
3691
|
-
}
|
|
3692
|
-
declare class MagmaStreamError<T = unknown> extends Error {
|
|
3693
|
-
readonly code: MagmaStreamErrorCode;
|
|
3694
|
-
readonly number: number;
|
|
3695
|
-
readonly context?: T;
|
|
3696
|
-
constructor({ code, message, cause, context }: MagmaStreamErrorOptions<T>);
|
|
3697
|
-
}
|
|
3698
|
-
|
|
3699
|
-
/**
|
|
3700
|
-
* Discordeno wrapper for Magmastream.
|
|
3701
|
-
*/
|
|
3702
|
-
declare class DiscordenoManager extends Manager {
|
|
3703
|
-
readonly client: Bot;
|
|
3704
|
-
constructor(client: Bot, options?: ManagerOptions);
|
|
3705
|
-
protected send(packet: GatewayVoiceStateUpdate): void;
|
|
3706
|
-
/**
|
|
3707
|
-
* Resolve a user by ID or partial info.
|
|
3708
|
-
* Uses user-provided cache getter if available, otherwise falls back to minimal info.
|
|
3709
|
-
*/
|
|
3710
|
-
resolveUser(user: AnyUser | string): Promise<User$2 | AnyUser>;
|
|
3711
|
-
resolveGuild(guildId: string): AnyGuild;
|
|
3712
|
-
}
|
|
3713
|
-
|
|
3714
|
-
/**
|
|
3715
|
-
* Discord.js wrapper for Magmastream.
|
|
3716
|
-
*/
|
|
3717
|
-
declare class DiscordJSManager extends Manager {
|
|
3718
|
-
readonly client: Client;
|
|
3719
|
-
constructor(client: Client, options?: ManagerOptions);
|
|
3720
|
-
protected send(packet: GatewayVoiceStateUpdate): void;
|
|
3721
|
-
resolveUser(user: AnyUser | string): Promise<User | AnyUser>;
|
|
3722
|
-
resolveGuild(guildId: string): Guild | null;
|
|
3723
|
-
}
|
|
3724
|
-
|
|
3725
|
-
/**
|
|
3726
|
-
* Eris wrapper for Magmastream.
|
|
3727
|
-
*/
|
|
3728
|
-
declare class ErisManager extends Manager {
|
|
3729
|
-
readonly client: Client$1;
|
|
3730
|
-
constructor(client: Client$1, options?: ManagerOptions);
|
|
3731
|
-
protected send(packet: GatewayVoiceStateUpdate): void;
|
|
3732
|
-
resolveUser(user: AnyUser | string): Promise<User$3 | AnyUser>;
|
|
3733
|
-
resolveGuild(guildId: string): Guild$3;
|
|
3734
|
-
}
|
|
3735
|
-
|
|
3736
|
-
/**
|
|
3737
|
-
* Oceanic wrapper for Magmastream.
|
|
3738
|
-
*/
|
|
3739
|
-
declare class OceanicManager extends Manager {
|
|
3740
|
-
readonly client: Client$2;
|
|
3741
|
-
constructor(client: Client$2, options?: ManagerOptions);
|
|
3742
|
-
protected send(packet: GatewayVoiceStateUpdate): void;
|
|
3743
|
-
resolveUser(user: AnyUser | string): Promise<User$1 | AnyUser>;
|
|
3744
|
-
resolveGuild(guildId: string): Guild$1;
|
|
3745
|
-
}
|
|
3746
|
-
|
|
3747
|
-
/**
|
|
3748
|
-
* Seyfert wrapper for Magmastream.
|
|
3749
|
-
*
|
|
3750
|
-
* @note This wrapper does require the manual implementation of the "raw" and "ready" events, to call the `updateVoiceState` and `init` methods respectively.
|
|
3751
|
-
*
|
|
3752
|
-
* @example
|
|
3753
|
-
* ```typescript
|
|
3754
|
-
* const client = new Client();
|
|
3755
|
-
* const manager = new SeyfertManager(client, options);
|
|
3756
|
-
*
|
|
3757
|
-
* client.events.values.RAW = {
|
|
3758
|
-
* data: { name: "raw" },
|
|
3759
|
-
* run: async (data) => {
|
|
3760
|
-
* await manager.updateVoiceState(data);
|
|
3761
|
-
* }
|
|
3762
|
-
* }
|
|
3763
|
-
*
|
|
3764
|
-
* client.events.values.READY = {
|
|
3765
|
-
* data: { name: "ready" },
|
|
3766
|
-
* run: async (user, client) => {
|
|
3767
|
-
* await manager.init({ clientId: client.botId });
|
|
3768
|
-
* }
|
|
3769
|
-
* }
|
|
3770
|
-
* ```
|
|
3771
|
-
*/
|
|
3772
|
-
declare class SeyfertManager extends Manager {
|
|
3773
|
-
readonly client: Client$3 | WorkerClient;
|
|
3774
|
-
constructor(client: Client$3 | WorkerClient, options?: ManagerOptions);
|
|
3775
|
-
protected send(packet: GatewayVoiceStateUpdate): void;
|
|
3776
|
-
resolveUser(user: AnyUser | string): Promise<User$4 | AnyUser>;
|
|
3777
|
-
resolveGuild(guildId: string): Guild$4<"cached">;
|
|
3778
|
-
}
|
|
3779
|
-
|
|
3780
|
-
export { AutoPlayPlatform, AutoPlayUtils, AvailableFilters, DiscordJSManager, DiscordenoManager, ErisManager, Filters, JSONUtils, JsonQueue, LoadTypes, MagmaStreamError, MagmaStreamErrorCode, MagmaStreamErrorNumbers, Manager, ManagerEventTypes, MemoryQueue, Node, OceanicManager, Player, PlayerStateEventTypes, PlayerUtils, Plugin, RedisQueue, Rest, SearchPlatform, SeverityTypes, SeyfertManager, SponsorBlockSegment, StateStorageType, StateTypes, Structure, TrackEndReasonTypes, TrackPartial, TrackSourceTypes, TrackUtils, UseNodeOptions };
|
|
3781
|
-
export type { AlbumSearchResult, AnyGuild, AnyMessage, AnyUser, ArtistSearchResult, CPUStats, DiscordPacket, DistortionOptions, EndSpeakingEventVoiceReceiver, EndSpeakingEventVoiceReceiverData, EqualizerBand, ErrorOrEmptySearchResult, Exception, Extendable, FrameStats, IQueue, JsonConfig, KaraokeOptions, LavaPlayer, LavalinkInfo, LavalinkResponse, LavalinkVoiceStateResponse, LavalinkVoiceStateUpdate, 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, PortableMessage, PortableUser, 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 };
|
|
1
|
+
export * from "./structures/Filters";
|
|
2
|
+
export * from "./structures/Manager";
|
|
3
|
+
export * from "./structures/Node";
|
|
4
|
+
export * from "./structures/Player";
|
|
5
|
+
export * from "./structures/Plugin";
|
|
6
|
+
export * from "./statestorage/MemoryQueue";
|
|
7
|
+
export * from "./structures/Rest";
|
|
8
|
+
export * from "./structures/Utils";
|
|
9
|
+
export * from "./structures/MagmastreamError";
|
|
10
|
+
export * from "./wrappers/discordeno";
|
|
11
|
+
export * from "./wrappers/discord.js";
|
|
12
|
+
export * from "./wrappers/eris";
|
|
13
|
+
export * from "./wrappers/oceanic";
|
|
14
|
+
export * from "./wrappers/seyfert";
|
|
15
|
+
export * from "./structures/Types";
|
|
16
|
+
export * from "./structures/Enums";
|
|
17
|
+
export * from "./statestorage/MemoryQueue";
|
|
18
|
+
export * from "./statestorage/JsonQueue";
|
|
19
|
+
export * from "./statestorage/RedisQueue";
|