lavalink-client 2.2.2 → 2.3.0
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/README.md +95 -1
- package/dist/cjs/index.d.ts +7 -1
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/structures/Constants.d.ts +40 -0
- package/dist/cjs/structures/Constants.js +244 -0
- package/dist/cjs/structures/CustomSearches/BandCampSearch.d.ts +2 -2
- package/dist/cjs/structures/Filters.d.ts +2 -217
- package/dist/cjs/structures/Filters.js +8 -232
- package/dist/cjs/structures/LavalinkManager.d.ts +31 -166
- package/dist/cjs/structures/LavalinkManager.js +59 -7
- package/dist/cjs/structures/LavalinkManagerStatics.d.ts +1 -1
- package/dist/cjs/structures/Node.d.ts +15 -156
- package/dist/cjs/structures/Node.js +131 -49
- package/dist/cjs/structures/NodeManager.d.ts +54 -52
- package/dist/cjs/structures/NodeManager.js +74 -4
- package/dist/cjs/structures/Player.d.ts +31 -124
- package/dist/cjs/structures/Player.js +77 -43
- package/dist/cjs/structures/Queue.d.ts +66 -42
- package/dist/cjs/structures/Queue.js +69 -11
- package/dist/cjs/structures/Types/Filters.d.ts +190 -0
- package/dist/cjs/structures/Types/Manager.d.ts +184 -0
- package/dist/cjs/structures/Types/Manager.js +2 -0
- package/dist/cjs/structures/Types/Node.d.ts +216 -0
- package/dist/cjs/structures/Types/Node.js +2 -0
- package/dist/cjs/structures/Types/Player.d.ts +108 -0
- package/dist/cjs/structures/Types/Player.js +2 -0
- package/dist/cjs/structures/Types/Queue.d.ts +34 -0
- package/dist/cjs/structures/Types/Queue.js +2 -0
- package/dist/cjs/structures/{Track.d.ts → Types/Track.d.ts} +3 -2
- package/dist/cjs/structures/Types/Track.js +2 -0
- package/dist/cjs/structures/Types/Utils.d.ts +367 -0
- package/dist/cjs/structures/Types/Utils.js +2 -0
- package/dist/cjs/structures/Utils.d.ts +13 -369
- package/dist/cjs/structures/Utils.js +35 -14
- package/dist/esm/index.d.ts +7 -1
- package/dist/esm/index.js +7 -1
- package/dist/esm/structures/Constants.d.ts +40 -0
- package/dist/esm/structures/Constants.js +241 -0
- package/dist/esm/structures/CustomSearches/BandCampSearch.d.ts +2 -2
- package/dist/esm/structures/Filters.d.ts +2 -217
- package/dist/esm/structures/Filters.js +3 -227
- package/dist/esm/structures/LavalinkManager.d.ts +31 -166
- package/dist/esm/structures/LavalinkManager.js +57 -5
- package/dist/esm/structures/LavalinkManagerStatics.d.ts +1 -1
- package/dist/esm/structures/Node.d.ts +15 -156
- package/dist/esm/structures/Node.js +122 -40
- package/dist/esm/structures/NodeManager.d.ts +54 -52
- package/dist/esm/structures/NodeManager.js +71 -1
- package/dist/esm/structures/Player.d.ts +31 -124
- package/dist/esm/structures/Player.js +76 -42
- package/dist/esm/structures/Queue.d.ts +66 -42
- package/dist/esm/structures/Queue.js +69 -11
- package/dist/esm/structures/Types/Filters.d.ts +190 -0
- package/dist/esm/structures/Types/Manager.d.ts +184 -0
- package/dist/esm/structures/Types/Manager.js +1 -0
- package/dist/esm/structures/Types/Node.d.ts +216 -0
- package/dist/esm/structures/Types/Node.js +1 -0
- package/dist/esm/structures/Types/Player.d.ts +108 -0
- package/dist/esm/structures/Types/Player.js +1 -0
- package/dist/esm/structures/Types/Queue.d.ts +34 -0
- package/dist/esm/structures/Types/Queue.js +1 -0
- package/dist/{types/structures → esm/structures/Types}/Track.d.ts +3 -2
- package/dist/esm/structures/Types/Track.js +1 -0
- package/dist/esm/structures/Types/Utils.d.ts +367 -0
- package/dist/esm/structures/Types/Utils.js +1 -0
- package/dist/esm/structures/Utils.d.ts +13 -369
- package/dist/esm/structures/Utils.js +35 -14
- package/dist/types/index.d.ts +7 -1
- package/dist/types/structures/Constants.d.ts +40 -0
- package/dist/types/structures/CustomSearches/BandCampSearch.d.ts +2 -2
- package/dist/types/structures/Filters.d.ts +2 -217
- package/dist/types/structures/LavalinkManager.d.ts +31 -166
- package/dist/types/structures/LavalinkManagerStatics.d.ts +1 -1
- package/dist/types/structures/Node.d.ts +15 -156
- package/dist/types/structures/NodeManager.d.ts +54 -52
- package/dist/types/structures/Player.d.ts +31 -124
- package/dist/types/structures/Queue.d.ts +66 -42
- package/dist/types/structures/Types/Filters.d.ts +190 -0
- package/dist/types/structures/Types/Manager.d.ts +184 -0
- package/dist/types/structures/Types/Node.d.ts +216 -0
- package/dist/types/structures/Types/Player.d.ts +108 -0
- package/dist/types/structures/Types/Queue.d.ts +34 -0
- package/dist/{esm/structures → types/structures/Types}/Track.d.ts +3 -2
- package/dist/types/structures/Types/Utils.d.ts +367 -0
- package/dist/types/structures/Utils.d.ts +13 -369
- package/package.json +1 -1
- /package/dist/cjs/structures/{Track.js → Types/Filters.js} +0 -0
- /package/dist/esm/structures/{Track.js → Types/Filters.js} +0 -0
|
@@ -1,58 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import type { LavalinkNodeOptions } from "./Types/Node";
|
|
2
|
+
import type { LavalinkSearchPlatform, LavaSearchQuery, MiniMapConstructor, SearchPlatform, SearchQuery } from "./Types/Utils";
|
|
3
|
+
import type { LavalinkManager } from "./LavalinkManager";
|
|
4
|
+
import type { LavalinkNode } from "./Node";
|
|
5
|
+
import type { Player } from "./Player";
|
|
6
|
+
import type { LavalinkTrack, Track, UnresolvedQuery, UnresolvedTrack } from "./Types/Track";
|
|
6
7
|
export declare const TrackSymbol: unique symbol;
|
|
7
8
|
export declare const UnresolvedTrackSymbol: unique symbol;
|
|
8
9
|
export declare const QueueSymbol: unique symbol;
|
|
9
10
|
export declare const NodeSymbol: unique symbol;
|
|
10
|
-
type Opaque<T, K> = T & {
|
|
11
|
-
__opaque__: K;
|
|
12
|
-
};
|
|
13
|
-
export type IntegerNumber = Opaque<number, 'Int'>;
|
|
14
|
-
export type FloatNumber = Opaque<number, 'Float'>;
|
|
15
|
-
export type LavaSrcSearchPlatformBase = "spsearch" | "sprec" | "amsearch" | "dzsearch" | "dzisrc" | "ymsearch";
|
|
16
|
-
export type LavaSrcSearchPlatform = LavaSrcSearchPlatformBase | "ftts";
|
|
17
|
-
export type DuncteSearchPlatform = "speak" | "phsearch" | "pornhub" | "porn" | "tts";
|
|
18
|
-
export type LavalinkClientSearchPlatform = "bcsearch";
|
|
19
|
-
export type LavalinkClientSearchPlatformResolve = "bandcamp" | "bc";
|
|
20
|
-
export type LavalinkSearchPlatform = "ytsearch" | "ytmsearch" | "scsearch" | "bcsearch" | LavaSrcSearchPlatform | DuncteSearchPlatform | LavalinkClientSearchPlatform;
|
|
21
|
-
export type ClientCustomSearchPlatformUtils = "local" | "http" | "https" | "link" | "uri";
|
|
22
|
-
export type ClientSearchPlatform = ClientCustomSearchPlatformUtils | // for file/link requests
|
|
23
|
-
"youtube" | "yt" | "youtube music" | "youtubemusic" | "ytm" | "musicyoutube" | "music youtube" | "soundcloud" | "sc" | "am" | "apple music" | "applemusic" | "apple" | "musicapple" | "music apple" | "sp" | "spsuggestion" | "spotify" | "spotify.com" | "spotifycom" | "dz" | "deezer" | "yandex" | "yandex music" | "yandexmusic" | "flowerytts" | "flowery" | "flowery.tts" | LavalinkClientSearchPlatformResolve | LavalinkClientSearchPlatform;
|
|
24
|
-
export type SearchPlatform = LavalinkSearchPlatform | ClientSearchPlatform;
|
|
25
|
-
export type SourcesRegex = "YoutubeRegex" | "YoutubeMusicRegex" | "SoundCloudRegex" | "SoundCloudMobileRegex" | "DeezerTrackRegex" | "DeezerArtistRegex" | "DeezerEpisodeRegex" | "DeezerMixesRegex" | "DeezerPageLinkRegex" | "DeezerPlaylistRegex" | "DeezerAlbumRegex" | "AllDeezerRegex" | "AllDeezerRegexWithoutPageLink" | "SpotifySongRegex" | "SpotifyPlaylistRegex" | "SpotifyArtistRegex" | "SpotifyEpisodeRegex" | "SpotifyShowRegex" | "SpotifyAlbumRegex" | "AllSpotifyRegex" | "mp3Url" | "m3uUrl" | "m3u8Url" | "mp4Url" | "m4aUrl" | "wavUrl" | "aacpUrl" | "tiktok" | "mixcloud" | "musicYandex" | "radiohost" | "bandcamp" | "appleMusic" | "TwitchTv" | "vimeo";
|
|
26
|
-
export interface PlaylistInfo {
|
|
27
|
-
/** The playlist name */
|
|
28
|
-
name: string;
|
|
29
|
-
/** The playlist title (same as name) */
|
|
30
|
-
title: string;
|
|
31
|
-
/** The playlist Author */
|
|
32
|
-
author?: string;
|
|
33
|
-
/** The playlist Thumbnail */
|
|
34
|
-
thumbnail?: string;
|
|
35
|
-
/** A Uri to the playlist */
|
|
36
|
-
uri?: string;
|
|
37
|
-
/** The playlist selected track. */
|
|
38
|
-
selectedTrack: Track | null;
|
|
39
|
-
/** The duration of the entire playlist. (calcualted) */
|
|
40
|
-
duration: number;
|
|
41
|
-
}
|
|
42
|
-
export interface SearchResult {
|
|
43
|
-
loadType: LoadTypes;
|
|
44
|
-
exception: Exception | null;
|
|
45
|
-
pluginInfo: PluginInfo;
|
|
46
|
-
playlist: PlaylistInfo | null;
|
|
47
|
-
tracks: Track[];
|
|
48
|
-
}
|
|
49
|
-
export interface UnresolvedSearchResult {
|
|
50
|
-
loadType: LoadTypes;
|
|
51
|
-
exception: Exception | null;
|
|
52
|
-
pluginInfo: PluginInfo;
|
|
53
|
-
playlist: PlaylistInfo | null;
|
|
54
|
-
tracks: UnresolvedTrack[];
|
|
55
|
-
}
|
|
56
11
|
/**
|
|
57
12
|
* Parses Node Connection Url: "lavalink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort>"
|
|
58
13
|
* @param connectionUrl
|
|
@@ -80,27 +35,28 @@ export declare class ManagerUtils {
|
|
|
80
35
|
* @param data
|
|
81
36
|
*/
|
|
82
37
|
isNode(data: LavalinkNode): boolean;
|
|
38
|
+
getTransformedRequester(requester: unknown): unknown;
|
|
83
39
|
/**
|
|
84
40
|
* Validate if a data is equal to node options
|
|
85
41
|
* @param data
|
|
86
42
|
*/
|
|
87
|
-
isNodeOptions(data: LavalinkNodeOptions
|
|
43
|
+
isNodeOptions(data: LavalinkNodeOptions): boolean;
|
|
88
44
|
/**
|
|
89
|
-
* Validate if a data is
|
|
45
|
+
* Validate if a data is equal to a track
|
|
90
46
|
* @param data the Track to validate
|
|
91
47
|
* @returns
|
|
92
48
|
*/
|
|
93
|
-
isTrack(data: Track |
|
|
49
|
+
isTrack(data: Track | UnresolvedTrack): data is Track;
|
|
94
50
|
/**
|
|
95
51
|
* Checks if the provided argument is a valid UnresolvedTrack.
|
|
96
52
|
* @param track
|
|
97
53
|
*/
|
|
98
|
-
isUnresolvedTrack(data: UnresolvedTrack |
|
|
54
|
+
isUnresolvedTrack(data: UnresolvedTrack | Track): data is UnresolvedTrack;
|
|
99
55
|
/**
|
|
100
56
|
* Checks if the provided argument is a valid UnresolvedTrack.
|
|
101
57
|
* @param track
|
|
102
58
|
*/
|
|
103
|
-
isUnresolvedTrackQuery(data: UnresolvedQuery
|
|
59
|
+
isUnresolvedTrackQuery(data: UnresolvedQuery): boolean;
|
|
104
60
|
getClosestTrack(data: UnresolvedTrack, player: Player): Promise<Track | undefined>;
|
|
105
61
|
validateQueryString(node: LavalinkNode, queryString: string, sourceString?: LavalinkSearchPlatform): void;
|
|
106
62
|
transformQuery(query: SearchQuery): {
|
|
@@ -115,16 +71,6 @@ export declare class ManagerUtils {
|
|
|
115
71
|
};
|
|
116
72
|
validateSourceString(node: LavalinkNode, sourceString: SearchPlatform): void;
|
|
117
73
|
}
|
|
118
|
-
/**
|
|
119
|
-
* @internal
|
|
120
|
-
*/
|
|
121
|
-
export interface MiniMapConstructor {
|
|
122
|
-
new (): MiniMap<unknown, unknown>;
|
|
123
|
-
new <K, V>(entries?: ReadonlyArray<readonly [K, V]> | null): MiniMap<K, V>;
|
|
124
|
-
new <K, V>(iterable: Iterable<readonly [K, V]>): MiniMap<K, V>;
|
|
125
|
-
readonly prototype: MiniMap<unknown, unknown>;
|
|
126
|
-
readonly [Symbol.species]: MiniMapConstructor;
|
|
127
|
-
}
|
|
128
74
|
/**
|
|
129
75
|
* Separate interface for the constructor so that emitted js does not have a constructor that overwrites itself
|
|
130
76
|
*
|
|
@@ -134,7 +80,7 @@ export interface MiniMap<K, V> extends Map<K, V> {
|
|
|
134
80
|
constructor: MiniMapConstructor;
|
|
135
81
|
}
|
|
136
82
|
export declare class MiniMap<K, V> extends Map<K, V> {
|
|
137
|
-
constructor(data?:
|
|
83
|
+
constructor(data?: [K, V][]);
|
|
138
84
|
/**
|
|
139
85
|
* Identical to
|
|
140
86
|
* [Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),
|
|
@@ -166,306 +112,4 @@ export declare class MiniMap<K, V> extends Map<K, V> {
|
|
|
166
112
|
map<T>(fn: (value: V, key: K, miniMap: this) => T): T[];
|
|
167
113
|
map<This, T>(fn: (this: This, value: V, key: K, miniMap: this) => T, thisArg: This): T[];
|
|
168
114
|
}
|
|
169
|
-
export type PlayerEvents = TrackStartEvent | TrackEndEvent | TrackStuckEvent | TrackExceptionEvent | WebSocketClosedEvent | SponsorBlockSegmentEvents;
|
|
170
|
-
export type Severity = "COMMON" | "SUSPICIOUS" | "FAULT";
|
|
171
|
-
export interface Exception {
|
|
172
|
-
/** Severity of the error */
|
|
173
|
-
severity: Severity;
|
|
174
|
-
/** Nodejs Error */
|
|
175
|
-
error?: Error;
|
|
176
|
-
/** Message by lavalink */
|
|
177
|
-
message: string;
|
|
178
|
-
/** Cause by lavalink */
|
|
179
|
-
cause: string;
|
|
180
|
-
}
|
|
181
|
-
export interface PlayerEvent {
|
|
182
|
-
op: "event";
|
|
183
|
-
type: PlayerEventType;
|
|
184
|
-
guildId: string;
|
|
185
|
-
}
|
|
186
|
-
export interface TrackStartEvent extends PlayerEvent {
|
|
187
|
-
type: "TrackStartEvent";
|
|
188
|
-
track: string;
|
|
189
|
-
}
|
|
190
|
-
export interface TrackEndEvent extends PlayerEvent {
|
|
191
|
-
type: "TrackEndEvent";
|
|
192
|
-
track: string;
|
|
193
|
-
reason: TrackEndReason;
|
|
194
|
-
}
|
|
195
|
-
export interface TrackExceptionEvent extends PlayerEvent {
|
|
196
|
-
type: "TrackExceptionEvent";
|
|
197
|
-
exception?: Exception;
|
|
198
|
-
error: string;
|
|
199
|
-
}
|
|
200
|
-
export interface TrackStuckEvent extends PlayerEvent {
|
|
201
|
-
type: "TrackStuckEvent";
|
|
202
|
-
thresholdMs: number;
|
|
203
|
-
}
|
|
204
|
-
export interface WebSocketClosedEvent extends PlayerEvent {
|
|
205
|
-
type: "WebSocketClosedEvent";
|
|
206
|
-
code: number;
|
|
207
|
-
byRemote: boolean;
|
|
208
|
-
reason: string;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Types & Events for Sponsorblock-plugin from Lavalink: https://github.com/topi314/Sponsorblock-Plugin#segmentsloaded
|
|
212
|
-
*/
|
|
213
|
-
export type SponsorBlockSegmentEvents = SponsorBlockSegmentSkipped | SponsorBlockSegmentsLoaded | SponsorBlockChapterStarted | SponsorBlockChaptersLoaded;
|
|
214
|
-
export type SponsorBlockSegmentEventType = "SegmentSkipped" | "SegmentsLoaded" | "ChaptersLoaded" | "ChapterStarted";
|
|
215
|
-
export interface SponsorBlockSegmentsLoaded extends PlayerEvent {
|
|
216
|
-
type: "SegmentsLoaded";
|
|
217
|
-
segments: {
|
|
218
|
-
category: string;
|
|
219
|
-
start: number;
|
|
220
|
-
end: number;
|
|
221
|
-
}[];
|
|
222
|
-
}
|
|
223
|
-
export interface SponsorBlockSegmentSkipped extends PlayerEvent {
|
|
224
|
-
type: "SegmentSkipped";
|
|
225
|
-
segment: {
|
|
226
|
-
category: string;
|
|
227
|
-
start: number;
|
|
228
|
-
end: number;
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
export interface SponsorBlockChapterStarted extends PlayerEvent {
|
|
232
|
-
type: "ChapterStarted";
|
|
233
|
-
/** The Chapter which started */
|
|
234
|
-
chapter: {
|
|
235
|
-
/** The Name of the Chapter */
|
|
236
|
-
name: string;
|
|
237
|
-
start: number;
|
|
238
|
-
end: number;
|
|
239
|
-
duration: number;
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
export interface SponsorBlockChaptersLoaded extends PlayerEvent {
|
|
243
|
-
type: "ChaptersLoaded";
|
|
244
|
-
/** All Chapters loaded */
|
|
245
|
-
chapters: {
|
|
246
|
-
/** The Name of the Chapter */
|
|
247
|
-
name: string;
|
|
248
|
-
start: number;
|
|
249
|
-
end: number;
|
|
250
|
-
duration: number;
|
|
251
|
-
}[];
|
|
252
|
-
}
|
|
253
|
-
export type LoadTypes = "track" | "playlist" | "search" | "error" | "empty";
|
|
254
|
-
export type State = "CONNECTED" | "CONNECTING" | "DISCONNECTED" | "DISCONNECTING" | "DESTROYING";
|
|
255
|
-
export type PlayerEventType = "TrackStartEvent" | "TrackEndEvent" | "TrackExceptionEvent" | "TrackStuckEvent" | "WebSocketClosedEvent" | SponsorBlockSegmentEventType;
|
|
256
|
-
export type TrackEndReason = "finished" | "loadFailed" | "stopped" | "replaced" | "cleanup";
|
|
257
|
-
export interface InvalidLavalinkRestRequest {
|
|
258
|
-
/** Rest Request Data for when it was made */
|
|
259
|
-
timestamp: number;
|
|
260
|
-
/** Status of the request */
|
|
261
|
-
status: number;
|
|
262
|
-
/** Specific Errro which was sent */
|
|
263
|
-
error: string;
|
|
264
|
-
/** Specific Message which was created */
|
|
265
|
-
message?: string;
|
|
266
|
-
/** The specific error trace from the request */
|
|
267
|
-
trace?: unknown;
|
|
268
|
-
/** Path of where it's from */
|
|
269
|
-
path: string;
|
|
270
|
-
}
|
|
271
|
-
export interface LavalinkPlayerVoice {
|
|
272
|
-
/** The Voice Token */
|
|
273
|
-
token: string;
|
|
274
|
-
/** The Voice Server Endpoint */
|
|
275
|
-
endpoint: string;
|
|
276
|
-
/** The Voice SessionId */
|
|
277
|
-
sessionId: string;
|
|
278
|
-
/** Wether or not the player is connected */
|
|
279
|
-
connected?: boolean;
|
|
280
|
-
/** The Ping to the voice server */
|
|
281
|
-
ping?: number;
|
|
282
|
-
}
|
|
283
|
-
export interface LavalinkPlayerVoiceOptions extends Omit<LavalinkPlayerVoice, 'connected' | 'ping'> {
|
|
284
|
-
}
|
|
285
|
-
export interface FailingAddress {
|
|
286
|
-
/** The failing address */
|
|
287
|
-
failingAddress: string;
|
|
288
|
-
/** The timestamp when the address failed */
|
|
289
|
-
failingTimestamp: number;
|
|
290
|
-
/** The timestamp when the address failed as a pretty string */
|
|
291
|
-
failingTime: string;
|
|
292
|
-
}
|
|
293
|
-
type RoutePlannerTypes = "RotatingIpRoutePlanner" | "NanoIpRoutePlanner" | "RotatingNanoIpRoutePlanner" | "BalancingIpRoutePlanner";
|
|
294
|
-
export interface RoutePlanner {
|
|
295
|
-
class?: RoutePlannerTypes;
|
|
296
|
-
details?: {
|
|
297
|
-
/** The ip block being used */
|
|
298
|
-
ipBlock: {
|
|
299
|
-
/** The type of the ip block */
|
|
300
|
-
type: "Inet4Address" | "Inet6Address";
|
|
301
|
-
/** The size of the ip block */
|
|
302
|
-
size: string;
|
|
303
|
-
};
|
|
304
|
-
/** The failing addresses */
|
|
305
|
-
failingAddresses: FailingAddress[];
|
|
306
|
-
/** The number of rotations */
|
|
307
|
-
rotateIndex?: string;
|
|
308
|
-
/** The current offset in the block */
|
|
309
|
-
ipIndex?: string;
|
|
310
|
-
/** The current address being used */
|
|
311
|
-
currentAddress?: string;
|
|
312
|
-
/** The current offset in the ip block */
|
|
313
|
-
currentAddressIndex?: string;
|
|
314
|
-
/** The information in which /64 block ips are chosen. This number increases on each ban. */
|
|
315
|
-
blockIndex?: string;
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
export interface Session {
|
|
319
|
-
/** Wether or not session is resuming or not */
|
|
320
|
-
resuming: boolean;
|
|
321
|
-
/** For how long a session is lasting while not connected */
|
|
322
|
-
timeout: number;
|
|
323
|
-
}
|
|
324
|
-
export interface GuildShardPayload {
|
|
325
|
-
/** The OP code */
|
|
326
|
-
op: number;
|
|
327
|
-
/** Data to send */
|
|
328
|
-
d: {
|
|
329
|
-
/** Guild id to apply voice settings */
|
|
330
|
-
guild_id: string;
|
|
331
|
-
/** channel to move/connect to, or null to leave it */
|
|
332
|
-
channel_id: string | null;
|
|
333
|
-
/** wether or not mute yourself */
|
|
334
|
-
self_mute: boolean;
|
|
335
|
-
/** wether or not deafen yourself */
|
|
336
|
-
self_deaf: boolean;
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
export interface PlayerUpdateInfo {
|
|
340
|
-
/** guild id of the player */
|
|
341
|
-
guildId: string;
|
|
342
|
-
/** Player options to provide to lavalink */
|
|
343
|
-
playerOptions: LavalinkPlayOptions;
|
|
344
|
-
/** Whether or not replace the current track with the new one (true is recommended) */
|
|
345
|
-
noReplace?: boolean;
|
|
346
|
-
}
|
|
347
|
-
export interface LavalinkPlayer {
|
|
348
|
-
/** Guild Id of the player */
|
|
349
|
-
guildId: string;
|
|
350
|
-
/** IF playing a track, all of the track information */
|
|
351
|
-
track?: LavalinkTrack;
|
|
352
|
-
/** Lavalink volume (mind volumedecrementer) */
|
|
353
|
-
volume: number;
|
|
354
|
-
/** Wether it's paused or not */
|
|
355
|
-
paused: boolean;
|
|
356
|
-
/** Voice Endpoint data */
|
|
357
|
-
voice: LavalinkPlayerVoice;
|
|
358
|
-
/** All Audio Filters */
|
|
359
|
-
filters: Partial<LavalinkFilterData>;
|
|
360
|
-
/** Lavalink-Voice-State Variables */
|
|
361
|
-
state: {
|
|
362
|
-
/** Time since connection established */
|
|
363
|
-
time: number;
|
|
364
|
-
/** Position of the track */
|
|
365
|
-
position: number;
|
|
366
|
-
/** COnnected or not */
|
|
367
|
-
connected: boolean;
|
|
368
|
-
/** Ping to voice server */
|
|
369
|
-
ping: number;
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
export interface ChannelDeletePacket {
|
|
373
|
-
/** Packet key for channel delete */
|
|
374
|
-
t: "CHANNEL_DELETE";
|
|
375
|
-
/** data which is sent and relevant */
|
|
376
|
-
d: {
|
|
377
|
-
/** guild id */
|
|
378
|
-
guild_id: string;
|
|
379
|
-
/** Channel id */
|
|
380
|
-
id: string;
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
export interface VoiceState {
|
|
384
|
-
/** OP key from lavalink */
|
|
385
|
-
op: "voiceUpdate";
|
|
386
|
-
/** GuildId provided by lavalink */
|
|
387
|
-
guildId: string;
|
|
388
|
-
/** Event data */
|
|
389
|
-
event: VoiceServer;
|
|
390
|
-
/** Session Id of the voice connection */
|
|
391
|
-
sessionId?: string;
|
|
392
|
-
/** guild id of the voice channel */
|
|
393
|
-
guild_id: string;
|
|
394
|
-
/** user id from the voice connection */
|
|
395
|
-
user_id: string;
|
|
396
|
-
/** Session Id of the voice connection */
|
|
397
|
-
session_id: string;
|
|
398
|
-
/** Voice Channel Id */
|
|
399
|
-
channel_id: string;
|
|
400
|
-
}
|
|
401
|
-
/** The Base64 decodes tring by lavalink */
|
|
402
|
-
export type Base64 = string;
|
|
403
|
-
export interface VoiceServer {
|
|
404
|
-
/** Voice Token */
|
|
405
|
-
token: string;
|
|
406
|
-
/** Guild Id of the voice server connection */
|
|
407
|
-
guild_id: string;
|
|
408
|
-
/** Server Endpoint */
|
|
409
|
-
endpoint: string;
|
|
410
|
-
}
|
|
411
|
-
export interface VoicePacket {
|
|
412
|
-
/** Voice Packet Keys to send */
|
|
413
|
-
t?: "VOICE_SERVER_UPDATE" | "VOICE_STATE_UPDATE";
|
|
414
|
-
/** Voice Packets to send */
|
|
415
|
-
d: VoiceState | VoiceServer;
|
|
416
|
-
}
|
|
417
|
-
export interface NodeMessage extends NodeStats {
|
|
418
|
-
/** The type of the event */
|
|
419
|
-
type: PlayerEventType;
|
|
420
|
-
/** what ops are applying to that event */
|
|
421
|
-
op: "stats" | "playerUpdate" | "event";
|
|
422
|
-
/** The specific guild id for that message */
|
|
423
|
-
guildId: string;
|
|
424
|
-
}
|
|
425
115
|
export declare function queueTrackEnd(player: Player): Promise<Track>;
|
|
426
|
-
/** Specific types to filter for lavasearch, will be filtered to correct types */
|
|
427
|
-
export type LavaSearchType = "track" | "album" | "artist" | "playlist" | "text" | "tracks" | "albums" | "artists" | "playlists" | "texts";
|
|
428
|
-
export interface LavaSearchFilteredResponse {
|
|
429
|
-
/** The Information of a playlist provided by lavasearch */
|
|
430
|
-
info: PlaylistInfo;
|
|
431
|
-
/** additional plugin information */
|
|
432
|
-
pluginInfo: PluginInfo;
|
|
433
|
-
/** List of tracks */
|
|
434
|
-
tracks: Track[];
|
|
435
|
-
}
|
|
436
|
-
export interface LavaSearchResponse {
|
|
437
|
-
/** An array of tracks, only present if track is in types */
|
|
438
|
-
tracks: Track[];
|
|
439
|
-
/** An array of albums, only present if album is in types */
|
|
440
|
-
albums: LavaSearchFilteredResponse[];
|
|
441
|
-
/** An array of artists, only present if artist is in types */
|
|
442
|
-
artists: LavaSearchFilteredResponse[];
|
|
443
|
-
/** An array of playlists, only present if playlist is in types */
|
|
444
|
-
playlists: LavaSearchFilteredResponse[];
|
|
445
|
-
/** An array of text results, only present if text is in types */
|
|
446
|
-
texts: {
|
|
447
|
-
text: string;
|
|
448
|
-
pluginInfo: PluginInfo;
|
|
449
|
-
}[];
|
|
450
|
-
/** Addition result data provided by plugins */
|
|
451
|
-
pluginInfo: PluginInfo;
|
|
452
|
-
}
|
|
453
|
-
/** SearchQuery Object for raw lavalink requests */
|
|
454
|
-
export type SearchQuery = {
|
|
455
|
-
/** lavalink search Query / identifier string */
|
|
456
|
-
query: string;
|
|
457
|
-
/** Extra url query params to use, e.g. for flowertts */
|
|
458
|
-
extraQueryUrlParams?: URLSearchParams;
|
|
459
|
-
/** Source to append to the search query string */
|
|
460
|
-
source?: SearchPlatform;
|
|
461
|
-
} | /** Our just the search query / identifier string */ string;
|
|
462
|
-
/** SearchQuery Object for Lavalink LavaSearch Plugin requests */
|
|
463
|
-
export type LavaSearchQuery = {
|
|
464
|
-
/** lavalink search Query / identifier string */
|
|
465
|
-
query: string;
|
|
466
|
-
/** Source to append to the search query string */
|
|
467
|
-
source: LavaSrcSearchPlatformBase;
|
|
468
|
-
/** The Types to filter the search to */
|
|
469
|
-
types?: LavaSearchType[];
|
|
470
|
-
};
|
|
471
|
-
export {};
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|