magmastream 2.9.3-dev.3 → 2.9.3-dev.30
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 -3687
- package/dist/index.js +1 -1
- package/dist/statestorage/JsonQueue.d.ts +173 -0
- package/dist/statestorage/JsonQueue.js +32 -4
- package/dist/statestorage/MemoryQueue.d.ts +154 -0
- package/dist/statestorage/MemoryQueue.js +56 -36
- package/dist/statestorage/RedisQueue.d.ts +178 -0
- package/dist/statestorage/RedisQueue.js +29 -7
- package/dist/structures/Enums.d.ts +310 -0
- package/dist/structures/Enums.js +6 -0
- package/dist/structures/Filters.d.ts +352 -0
- package/dist/structures/Filters.js +5 -4
- package/dist/structures/MagmastreamError.d.ts +14 -0
- package/dist/structures/Manager.d.ts +259 -0
- package/dist/structures/Manager.js +297 -555
- package/dist/structures/Node.d.ts +390 -0
- package/dist/structures/Node.js +98 -143
- package/dist/structures/Player.d.ts +347 -0
- package/dist/structures/Player.js +53 -127
- package/dist/structures/Plugin.d.ts +23 -0
- package/dist/structures/Rest.d.ts +93 -0
- package/dist/structures/Rest.js +41 -21
- package/dist/structures/Types.d.ts +1315 -0
- package/dist/structures/Utils.d.ts +169 -0
- package/dist/structures/Utils.js +145 -71
- 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/discord.js.js +19 -4
- package/dist/wrappers/discordeno.d.ts +19 -0
- package/dist/wrappers/discordeno.js +77 -0
- package/dist/wrappers/eris.d.ts +15 -0
- package/dist/wrappers/eris.js +20 -3
- package/dist/wrappers/oceanic.d.ts +15 -0
- package/dist/wrappers/oceanic.js +22 -4
- package/dist/wrappers/seyfert.d.ts +37 -0
- package/dist/wrappers/seyfert.js +25 -1
- package/package.json +106 -98
- package/dist/wrappers/detritus.js +0 -52
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { Manager } from "./Manager";
|
|
2
|
+
import { Player } from "./Player";
|
|
3
|
+
import { Rest } from "./Rest";
|
|
4
|
+
import WebSocket from "ws";
|
|
5
|
+
import { LavalinkInfo, Lyrics, NodeLinkGetLyrics, NodeOptions, NodeStats, PlayerEvent, PlayerEvents, Track, TrackEndEvent, TrackExceptionEvent, TrackStartEvent, TrackStuckEvent, WebSocketClosedEvent } from "./Types";
|
|
6
|
+
import { SponsorBlockSegment } from "./Enums";
|
|
7
|
+
export declare class Node {
|
|
8
|
+
manager: Manager;
|
|
9
|
+
options: NodeOptions;
|
|
10
|
+
/** The socket for the node. */
|
|
11
|
+
socket: WebSocket | null;
|
|
12
|
+
/** The stats for the node. */
|
|
13
|
+
stats: NodeStats;
|
|
14
|
+
/** The manager for the node */
|
|
15
|
+
/** The node's session ID. */
|
|
16
|
+
sessionId: string | null;
|
|
17
|
+
/** The REST instance. */
|
|
18
|
+
readonly rest: Rest;
|
|
19
|
+
/** Actual Lavalink information of the node. */
|
|
20
|
+
info: LavalinkInfo | null;
|
|
21
|
+
/** Whether the node is a NodeLink. */
|
|
22
|
+
isNodeLink: boolean;
|
|
23
|
+
private reconnectTimeout?;
|
|
24
|
+
private reconnectAttempts;
|
|
25
|
+
private redisPrefix?;
|
|
26
|
+
private sessionIdsMap;
|
|
27
|
+
/**
|
|
28
|
+
* Creates an instance of Node.
|
|
29
|
+
* @param manager - The manager for the node.
|
|
30
|
+
* @param options - The options for the node.
|
|
31
|
+
*/
|
|
32
|
+
constructor(manager: Manager, options: NodeOptions);
|
|
33
|
+
/**
|
|
34
|
+
* Checks if the Node is currently connected.
|
|
35
|
+
* This method returns true if the Node has an active WebSocket connection, indicating it is ready to receive and process commands.
|
|
36
|
+
*/
|
|
37
|
+
get connected(): boolean;
|
|
38
|
+
/** Returns the full address for this node, including the host and port. */
|
|
39
|
+
get address(): string;
|
|
40
|
+
private getCompositeKey;
|
|
41
|
+
private getRedisSessionIdsKey;
|
|
42
|
+
private getNodeSessionsDir;
|
|
43
|
+
private getNodeSessionPath;
|
|
44
|
+
/**
|
|
45
|
+
* Loads session IDs from the sessionIds.json file if it exists.
|
|
46
|
+
* The session IDs are used to resume sessions for each node.
|
|
47
|
+
*
|
|
48
|
+
* The session IDs are stored in the sessionIds.json file as a composite key
|
|
49
|
+
* of the node identifier and cluster ID. This allows multiple clusters to
|
|
50
|
+
* be used with the same node identifier.
|
|
51
|
+
*/
|
|
52
|
+
loadSessionIds(): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Updates the session ID in the sessionIds.json file.
|
|
55
|
+
*
|
|
56
|
+
* This method is called after the session ID has been updated, and it
|
|
57
|
+
* writes the new session ID to the sessionIds.json file.
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* The session ID is stored in the sessionIds.json file as a composite key
|
|
61
|
+
* of the node identifier and cluster ID. This allows multiple clusters to
|
|
62
|
+
* be used with the same node identifier.
|
|
63
|
+
*/
|
|
64
|
+
updateSessionId(): Promise<void>;
|
|
65
|
+
private updateSessionIdFile;
|
|
66
|
+
private updateSessionIdRedis;
|
|
67
|
+
/**
|
|
68
|
+
* Connects to the Node.
|
|
69
|
+
*
|
|
70
|
+
* @remarks
|
|
71
|
+
* If the node is already connected, this method will do nothing.
|
|
72
|
+
* If the node has a session ID, it will be sent in the headers of the WebSocket connection.
|
|
73
|
+
* If the node has no session ID but the `enableSessionResumeOption` option is true, it will use the session ID
|
|
74
|
+
* stored in the sessionIds.json file if it exists.
|
|
75
|
+
*/
|
|
76
|
+
connect(): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Destroys the node and cleans up associated resources.
|
|
79
|
+
*
|
|
80
|
+
* This method emits a debug event indicating that the node is being destroyed and attempts
|
|
81
|
+
* to automatically move all players connected to the node to a usable one. It then closes
|
|
82
|
+
* the WebSocket connection, removes all event listeners, and clears the reconnect timeout.
|
|
83
|
+
* Finally, it emits a "nodeDestroy" event and removes the node from the manager.
|
|
84
|
+
*
|
|
85
|
+
* @returns {Promise<void>} A promise that resolves when the node and its resources have been destroyed.
|
|
86
|
+
*/
|
|
87
|
+
destroy(): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Attempts to reconnect to the node if the connection is lost.
|
|
90
|
+
*
|
|
91
|
+
* This method is called when the WebSocket connection is closed
|
|
92
|
+
* unexpectedly. It will attempt to reconnect to the node after a
|
|
93
|
+
* specified delay, and will continue to do so until the maximum
|
|
94
|
+
* number of retry attempts is reached or the node is manually destroyed.
|
|
95
|
+
* If the maximum number of retry attempts is reached, an error event
|
|
96
|
+
* will be emitted and the node will be destroyed.
|
|
97
|
+
*
|
|
98
|
+
* @returns {Promise<void>} - Resolves when the reconnection attempt is scheduled.
|
|
99
|
+
* @emits {debug} - Emits a debug event indicating the node is attempting to reconnect.
|
|
100
|
+
* @emits {nodeReconnect} - Emits a nodeReconnect event when the node is attempting to reconnect.
|
|
101
|
+
* @emits {nodeError} - Emits an error event if the maximum number of retry attempts is reached.
|
|
102
|
+
* @emits {nodeDestroy} - Emits a nodeDestroy event if the maximum number of retry attempts is reached.
|
|
103
|
+
*/
|
|
104
|
+
private reconnect;
|
|
105
|
+
/**
|
|
106
|
+
* Upgrades the node to a NodeLink.
|
|
107
|
+
*
|
|
108
|
+
* @param request - The incoming message.
|
|
109
|
+
*/
|
|
110
|
+
private upgrade;
|
|
111
|
+
/**
|
|
112
|
+
* Handles the "open" event emitted by the WebSocket connection.
|
|
113
|
+
*
|
|
114
|
+
* This method is called when the WebSocket connection is established.
|
|
115
|
+
* It clears any existing reconnect timeouts, emits a debug event
|
|
116
|
+
* indicating the node is connected, and emits a "nodeConnect" event
|
|
117
|
+
* with the node as the argument.
|
|
118
|
+
*/
|
|
119
|
+
protected open(): void;
|
|
120
|
+
/**
|
|
121
|
+
* Handles the "close" event emitted by the WebSocket connection.
|
|
122
|
+
*
|
|
123
|
+
* This method is called when the WebSocket connection is closed.
|
|
124
|
+
* It emits a "nodeDisconnect" event with the node and the close event as arguments,
|
|
125
|
+
* and a debug event indicating the node is disconnected.
|
|
126
|
+
* It then attempts to move all players connected to that node to a useable one.
|
|
127
|
+
* If the close event was not initiated by the user, it will also attempt to reconnect.
|
|
128
|
+
*
|
|
129
|
+
* @param {number} code The close code of the WebSocket connection.
|
|
130
|
+
* @param {string} reason The reason for the close event.
|
|
131
|
+
* @returns {Promise<void>} A promise that resolves when the disconnection is handled.
|
|
132
|
+
*/
|
|
133
|
+
protected close(code: number, reason: string): Promise<void>;
|
|
134
|
+
/**
|
|
135
|
+
* Handles the "error" event emitted by the WebSocket connection.
|
|
136
|
+
*
|
|
137
|
+
* This method is called when an error occurs on the WebSocket connection.
|
|
138
|
+
* It emits a "nodeError" event with the node and the error as arguments and
|
|
139
|
+
* a debug event indicating the error on the node.
|
|
140
|
+
* @param {Error} error The error that occurred.
|
|
141
|
+
*/
|
|
142
|
+
protected error(error: Error): void;
|
|
143
|
+
/**
|
|
144
|
+
* Handles incoming messages from the Lavalink WebSocket connection.
|
|
145
|
+
* @param {Buffer | string} d The message received from the WebSocket connection.
|
|
146
|
+
* @returns {Promise<void>} A promise that resolves when the message is handled.
|
|
147
|
+
* @emits {debug} - Emits a debug event with the message received from the WebSocket connection.
|
|
148
|
+
* @emits {nodeError} - Emits a nodeError event if an unexpected op is received.
|
|
149
|
+
* @emits {nodeRaw} - Emits a nodeRaw event with the raw message received from the WebSocket connection.
|
|
150
|
+
* @private
|
|
151
|
+
*/
|
|
152
|
+
protected message(d: Buffer | string): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Handles an event emitted from the Lavalink node.
|
|
155
|
+
* @param {PlayerEvent & PlayerEvents} payload The event emitted from the node.
|
|
156
|
+
* @returns {Promise<void>} A promise that resolves when the event has been handled.
|
|
157
|
+
* @private
|
|
158
|
+
*/
|
|
159
|
+
protected handleEvent(payload: PlayerEvent & PlayerEvents): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Emitted when a new track starts playing.
|
|
162
|
+
* @param {Player} player The player that started playing the track.
|
|
163
|
+
* @param {Track} track The track that started playing.
|
|
164
|
+
* @param {TrackStartEvent} payload The payload of the event emitted by the node.
|
|
165
|
+
* @private
|
|
166
|
+
*/
|
|
167
|
+
protected trackStart(player: Player, track: Track, payload: TrackStartEvent): void;
|
|
168
|
+
/**
|
|
169
|
+
* Emitted when a track ends playing.
|
|
170
|
+
* @param {Player} player - The player that the track ended on.
|
|
171
|
+
* @param {Track} track - The track that ended.
|
|
172
|
+
* @param {TrackEndEvent} payload - The payload of the event emitted by the node.
|
|
173
|
+
* @private
|
|
174
|
+
*/
|
|
175
|
+
trackEnd(player: Player, track: Track, payload: TrackEndEvent): Promise<void>;
|
|
176
|
+
/**
|
|
177
|
+
* Handles autoplay logic for a player.
|
|
178
|
+
* This method is responsible for selecting an appropriate method of autoplay
|
|
179
|
+
* and executing it. If autoplay is not enabled or all attempts have failed,
|
|
180
|
+
* it will return false.
|
|
181
|
+
* @param {Player} player - The player to handle autoplay for.
|
|
182
|
+
* @param {number} attempt - The current attempt number of the autoplay.
|
|
183
|
+
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating if autoplay was successful.
|
|
184
|
+
* @private
|
|
185
|
+
*/
|
|
186
|
+
private handleAutoplay;
|
|
187
|
+
/**
|
|
188
|
+
* Handles the scenario when a track fails to play or load.
|
|
189
|
+
* Shifts the queue to the next track and emits a track end event.
|
|
190
|
+
* If there is no next track, handles the queue end scenario.
|
|
191
|
+
* If autoplay is enabled, plays the next track.
|
|
192
|
+
*
|
|
193
|
+
* @param {Player} player - The player instance associated with the track.
|
|
194
|
+
* @param {Track} track - The track that failed.
|
|
195
|
+
* @param {TrackEndEvent} payload - The event payload containing details about the track end.
|
|
196
|
+
* @returns {Promise<void>} A promise that resolves when the track failure has been processed.
|
|
197
|
+
* @private
|
|
198
|
+
*/
|
|
199
|
+
private handleFailedTrack;
|
|
200
|
+
/**
|
|
201
|
+
* Handles the scenario when a track is repeated.
|
|
202
|
+
* Shifts the queue to the next track and emits a track end event.
|
|
203
|
+
* If there is no next track, handles the queue end scenario.
|
|
204
|
+
* If autoplay is enabled, plays the next track.
|
|
205
|
+
*
|
|
206
|
+
* @param {Player} player - The player instance associated with the track.
|
|
207
|
+
* @param {Track} track - The track that is repeated.
|
|
208
|
+
* @param {TrackEndEvent} payload - The event payload containing details about the track end.
|
|
209
|
+
* @returns {Promise<void>} A promise that resolves when the repeated track has been processed.
|
|
210
|
+
* @private
|
|
211
|
+
*/
|
|
212
|
+
private handleRepeatedTrack;
|
|
213
|
+
/**
|
|
214
|
+
* Plays the next track in the queue.
|
|
215
|
+
* Updates the queue by shifting the current track to the previous track
|
|
216
|
+
* and plays the next track if autoplay is enabled.
|
|
217
|
+
*
|
|
218
|
+
* @param {Player} player - The player associated with the track.
|
|
219
|
+
* @param {Track} track - The track that has ended.
|
|
220
|
+
* @param {TrackEndEvent} payload - The event payload containing additional data about the track end event.
|
|
221
|
+
* @returns {void}
|
|
222
|
+
* @private
|
|
223
|
+
*/
|
|
224
|
+
private playNextTrack;
|
|
225
|
+
/**
|
|
226
|
+
* Handles the event when a queue ends.
|
|
227
|
+
* If autoplay is enabled, attempts to play the next track in the queue using the autoplay logic.
|
|
228
|
+
* If all attempts fail, resets the player state and emits the `queueEnd` event.
|
|
229
|
+
* @param {Player} player - The player associated with the track.
|
|
230
|
+
* @param {Track} track - The track that has ended.
|
|
231
|
+
* @param {TrackEndEvent} payload - The event payload containing additional data about the track end event.
|
|
232
|
+
* @returns {Promise<void>} A promise that resolves when the queue end processing is complete.
|
|
233
|
+
*/
|
|
234
|
+
queueEnd(player: Player, track: Track, payload: TrackEndEvent): Promise<void>;
|
|
235
|
+
/**
|
|
236
|
+
* Fetches the lyrics of a track from the Lavalink node.
|
|
237
|
+
*
|
|
238
|
+
* If the node is a NodeLink, it will use the `NodeLinkGetLyrics` method to fetch the lyrics.
|
|
239
|
+
*
|
|
240
|
+
* Requires the `lavalyrics-plugin` to be present in the Lavalink node.
|
|
241
|
+
* Requires the `lavasrc-plugin` or `java-lyrics-plugin` to be present in the Lavalink node.
|
|
242
|
+
*
|
|
243
|
+
* @param {Track} track - The track to fetch the lyrics for.
|
|
244
|
+
* @param {boolean} [skipTrackSource=false] - Whether to skip using the track's source URL.
|
|
245
|
+
* @param {string} [language="en"] - The language of the lyrics.
|
|
246
|
+
* @returns {Promise<Lyrics | NodeLinkGetLyrics>} A promise that resolves with the lyrics data.
|
|
247
|
+
*/
|
|
248
|
+
getLyrics(track: Track, skipTrackSource?: boolean, language?: string): Promise<Lyrics | NodeLinkGetLyrics>;
|
|
249
|
+
/**
|
|
250
|
+
* Subscribes to lyrics for a player.
|
|
251
|
+
* @param {string} guildId - The ID of the guild to subscribe to lyrics for.
|
|
252
|
+
* @param {boolean} [skipTrackSource=false] - Whether to skip using the track's source URL.
|
|
253
|
+
* @returns {Promise<unknown>} A promise that resolves when the subscription is complete.
|
|
254
|
+
* @throws {RangeError} If the node is not connected to the lavalink server or if the java-lyrics-plugin is not available.
|
|
255
|
+
*/
|
|
256
|
+
lyricsSubscribe(guildId: string, skipTrackSource?: boolean): Promise<unknown>;
|
|
257
|
+
/**
|
|
258
|
+
* Unsubscribes from lyrics for a player.
|
|
259
|
+
* @param {string} guildId - The ID of the guild to unsubscribe from lyrics for.
|
|
260
|
+
* @returns {Promise<unknown>} A promise that resolves when the unsubscription is complete.
|
|
261
|
+
* @throws {RangeError} If the node is not connected to the lavalink server or if the java-lyrics-plugin is not available.
|
|
262
|
+
*/
|
|
263
|
+
lyricsUnsubscribe(guildId: string): Promise<unknown>;
|
|
264
|
+
/**
|
|
265
|
+
* Handles the event when a track becomes stuck during playback.
|
|
266
|
+
* Stops the current track and emits a `trackStuck` event.
|
|
267
|
+
*
|
|
268
|
+
* @param {Player} player - The player associated with the track that became stuck.
|
|
269
|
+
* @param {Track} track - The track that became stuck.
|
|
270
|
+
* @param {TrackStuckEvent} payload - The event payload containing additional data about the track stuck event.
|
|
271
|
+
* @returns {void}
|
|
272
|
+
* @protected
|
|
273
|
+
*/
|
|
274
|
+
protected trackStuck(player: Player, track: Track, payload: TrackStuckEvent): Promise<void>;
|
|
275
|
+
/**
|
|
276
|
+
* Handles the event when a track has an error during playback.
|
|
277
|
+
* Stops the current track and emits a `trackError` event.
|
|
278
|
+
*
|
|
279
|
+
* @param {Player} player - The player associated with the track that had an error.
|
|
280
|
+
* @param {Track} track - The track that had an error.
|
|
281
|
+
* @param {TrackExceptionEvent} payload - The event payload containing additional data about the track error event.
|
|
282
|
+
* @returns {void}
|
|
283
|
+
* @protected
|
|
284
|
+
*/
|
|
285
|
+
protected trackError(player: Player, track: Track, payload: TrackExceptionEvent): Promise<void>;
|
|
286
|
+
/**
|
|
287
|
+
* Emitted when the WebSocket connection for a player closes.
|
|
288
|
+
* The payload of the event will contain the close code and reason if provided.
|
|
289
|
+
* @param {Player} player - The player associated with the WebSocket connection.
|
|
290
|
+
* @param {WebSocketClosedEvent} payload - The event payload containing additional data about the WebSocket close event.
|
|
291
|
+
*/
|
|
292
|
+
protected socketClosed(player: Player, payload: WebSocketClosedEvent): void;
|
|
293
|
+
/**
|
|
294
|
+
* Emitted when the segments for a track are loaded.
|
|
295
|
+
* The payload of the event will contain the segments.
|
|
296
|
+
* @param {Player} player - The player associated with the segments.
|
|
297
|
+
* @param {Track} track - The track associated with the segments.
|
|
298
|
+
* @param {SponsorBlockSegmentsLoaded} payload - The event payload containing additional data about the segments loaded event.
|
|
299
|
+
*/
|
|
300
|
+
private sponsorBlockSegmentLoaded;
|
|
301
|
+
/**
|
|
302
|
+
* Emitted when a segment of a track is skipped using the sponsorblock plugin.
|
|
303
|
+
* The payload of the event will contain the skipped segment.
|
|
304
|
+
* @param {Player} player - The player associated with the skipped segment.
|
|
305
|
+
* @param {Track} track - The track associated with the skipped segment.
|
|
306
|
+
* @param {SponsorBlockSegmentSkipped} payload - The event payload containing additional data about the segment skipped event.
|
|
307
|
+
*/
|
|
308
|
+
private sponsorBlockSegmentSkipped;
|
|
309
|
+
/**
|
|
310
|
+
* Emitted when chapters for a track are loaded using the sponsorblock plugin.
|
|
311
|
+
* The payload of the event will contain the chapters.
|
|
312
|
+
* @param {Player} player - The player associated with the chapters.
|
|
313
|
+
* @param {Track} track - The track associated with the chapters.
|
|
314
|
+
* @param {SponsorBlockChaptersLoaded} payload - The event payload containing additional data about the chapters loaded event.
|
|
315
|
+
*/
|
|
316
|
+
private sponsorBlockChaptersLoaded;
|
|
317
|
+
/**
|
|
318
|
+
* Emitted when a chapter of a track is started using the sponsorblock plugin.
|
|
319
|
+
* The payload of the event will contain the started chapter.
|
|
320
|
+
* @param {Player} player - The player associated with the started chapter.
|
|
321
|
+
* @param {Track} track - The track associated with the started chapter.
|
|
322
|
+
* @param {SponsorBlockChapterStarted} payload - The event payload containing additional data about the chapter started event.
|
|
323
|
+
*/
|
|
324
|
+
private sponsorBlockChapterStarted;
|
|
325
|
+
/**
|
|
326
|
+
* Emitted when lyrics for a track are found.
|
|
327
|
+
* The payload of the event will contain the lyrics.
|
|
328
|
+
* @param {Player} player - The player associated with the lyrics.
|
|
329
|
+
* @param {Track} track - The track associated with the lyrics.
|
|
330
|
+
* @param {LyricsFoundEvent} payload - The event payload containing additional data about the lyrics found event.
|
|
331
|
+
*/
|
|
332
|
+
private lyricsFound;
|
|
333
|
+
/**
|
|
334
|
+
* Emitted when lyrics for a track are not found.
|
|
335
|
+
* The payload of the event will contain the track.
|
|
336
|
+
* @param {Player} player - The player associated with the lyrics.
|
|
337
|
+
* @param {Track} track - The track associated with the lyrics.
|
|
338
|
+
* @param {LyricsNotFoundEvent} payload - The event payload containing additional data about the lyrics not found event.
|
|
339
|
+
*/
|
|
340
|
+
private lyricsNotFound;
|
|
341
|
+
/**
|
|
342
|
+
* Emitted when a line of lyrics for a track is received.
|
|
343
|
+
* The payload of the event will contain the lyrics line.
|
|
344
|
+
* @param {Player} player - The player associated with the lyrics line.
|
|
345
|
+
* @param {Track} track - The track associated with the lyrics line.
|
|
346
|
+
* @param {LyricsLineEvent} payload - The event payload containing additional data about the lyrics line event.
|
|
347
|
+
*/
|
|
348
|
+
private lyricsLine;
|
|
349
|
+
/**
|
|
350
|
+
* Fetches Lavalink node information.
|
|
351
|
+
* @returns {Promise<LavalinkInfo>} A promise that resolves to the Lavalink node information.
|
|
352
|
+
*/
|
|
353
|
+
fetchInfo(): Promise<LavalinkInfo>;
|
|
354
|
+
/**
|
|
355
|
+
* Gets the current sponsorblock segments for a player.
|
|
356
|
+
* @param {Player} player - The player to get the sponsorblocks for.
|
|
357
|
+
* @returns {Promise<SponsorBlockSegment[]>} A promise that resolves to the sponsorblock segments.
|
|
358
|
+
* @throws {RangeError} If the sponsorblock-plugin is not available in the Lavalink node.
|
|
359
|
+
*/
|
|
360
|
+
getSponsorBlock(player: Player): Promise<SponsorBlockSegment[]>;
|
|
361
|
+
/**
|
|
362
|
+
* Sets the sponsorblock segments for a player.
|
|
363
|
+
* @param {Player} player - The player to set the sponsor blocks for.
|
|
364
|
+
* @param {SponsorBlockSegment[]} segments - The sponsorblock segments to set. Defaults to `[SponsorBlockSegment.Sponsor, SponsorBlockSegment.SelfPromo]` if not provided.
|
|
365
|
+
* @returns {Promise<void>} The promise is resolved when the operation is complete.
|
|
366
|
+
* @throws {RangeError} If the sponsorblock-plugin is not available in the Lavalink node.
|
|
367
|
+
* @throws {RangeError} If no segments are provided.
|
|
368
|
+
* @throws {SyntaxError} If an invalid sponsorblock is provided.
|
|
369
|
+
* @example
|
|
370
|
+
* ```ts
|
|
371
|
+
* // use it on the player via player.setSponsorBlock();
|
|
372
|
+
* player.setSponsorBlock([SponsorBlockSegment.Sponsor, SponsorBlockSegment.SelfPromo]);
|
|
373
|
+
* ```
|
|
374
|
+
*/
|
|
375
|
+
setSponsorBlock(player: Player, segments?: SponsorBlockSegment[]): Promise<void>;
|
|
376
|
+
/**
|
|
377
|
+
* Deletes the sponsorblock segments for a player.
|
|
378
|
+
* @param {Player} player - The player to delete the sponsorblocks for.
|
|
379
|
+
* @returns {Promise<void>} The promise is resolved when the operation is complete.
|
|
380
|
+
* @throws {RangeError} If the sponsorblock-plugin is not available in the Lavalink node.
|
|
381
|
+
*/
|
|
382
|
+
deleteSponsorBlock(player: Player): Promise<void>;
|
|
383
|
+
/**
|
|
384
|
+
* Creates a README.md or README.txt file in the magmastream directory
|
|
385
|
+
* if it doesn't already exist. This file is used to store player data
|
|
386
|
+
* for autoresume and other features.
|
|
387
|
+
* @private
|
|
388
|
+
*/
|
|
389
|
+
private createReadmeFile;
|
|
390
|
+
}
|