lavalink-client 2.5.7 → 2.5.8
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 +9 -2
- package/dist/index.d.mts +3036 -0
- package/dist/index.d.ts +3036 -0
- package/dist/index.js +4965 -0
- package/dist/index.mjs +4904 -0
- package/package.json +21 -24
- package/dist/cjs/index.d.ts +0 -16
- package/dist/cjs/index.js +0 -19
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/structures/Constants.d.ts +0 -90
- package/dist/cjs/structures/Constants.js +0 -296
- package/dist/cjs/structures/CustomSearches/BandCampSearch.d.ts +0 -3
- package/dist/cjs/structures/CustomSearches/BandCampSearch.js +0 -39
- package/dist/cjs/structures/Filters.d.ts +0 -169
- package/dist/cjs/structures/Filters.js +0 -700
- package/dist/cjs/structures/LavalinkManager.d.ts +0 -232
- package/dist/cjs/structures/LavalinkManager.js +0 -621
- package/dist/cjs/structures/LavalinkManagerStatics.d.ts +0 -15
- package/dist/cjs/structures/LavalinkManagerStatics.js +0 -149
- package/dist/cjs/structures/Node.d.ts +0 -523
- package/dist/cjs/structures/Node.js +0 -1605
- package/dist/cjs/structures/NodeManager.d.ts +0 -100
- package/dist/cjs/structures/NodeManager.js +0 -224
- package/dist/cjs/structures/Player.d.ts +0 -223
- package/dist/cjs/structures/Player.js +0 -807
- package/dist/cjs/structures/Queue.d.ts +0 -186
- package/dist/cjs/structures/Queue.js +0 -390
- package/dist/cjs/structures/Types/Filters.d.ts +0 -190
- package/dist/cjs/structures/Types/Filters.js +0 -2
- package/dist/cjs/structures/Types/Manager.d.ts +0 -271
- package/dist/cjs/structures/Types/Manager.js +0 -2
- package/dist/cjs/structures/Types/Node.d.ts +0 -238
- package/dist/cjs/structures/Types/Node.js +0 -2
- package/dist/cjs/structures/Types/Player.d.ts +0 -114
- package/dist/cjs/structures/Types/Player.js +0 -2
- package/dist/cjs/structures/Types/Queue.d.ts +0 -35
- package/dist/cjs/structures/Types/Queue.js +0 -2
- package/dist/cjs/structures/Types/Track.d.ts +0 -134
- package/dist/cjs/structures/Types/Track.js +0 -2
- package/dist/cjs/structures/Types/Utils.d.ts +0 -443
- package/dist/cjs/structures/Types/Utils.js +0 -2
- package/dist/cjs/structures/Utils.d.ts +0 -116
- package/dist/cjs/structures/Utils.js +0 -567
- package/dist/esm/index.d.ts +0 -16
- package/dist/esm/index.js +0 -16
- package/dist/esm/package.json +0 -3
- package/dist/esm/structures/Constants.d.ts +0 -90
- package/dist/esm/structures/Constants.js +0 -293
- package/dist/esm/structures/CustomSearches/BandCampSearch.d.ts +0 -3
- package/dist/esm/structures/CustomSearches/BandCampSearch.js +0 -35
- package/dist/esm/structures/Filters.d.ts +0 -169
- package/dist/esm/structures/Filters.js +0 -696
- package/dist/esm/structures/LavalinkManager.d.ts +0 -232
- package/dist/esm/structures/LavalinkManager.js +0 -617
- package/dist/esm/structures/LavalinkManagerStatics.d.ts +0 -15
- package/dist/esm/structures/LavalinkManagerStatics.js +0 -146
- package/dist/esm/structures/Node.d.ts +0 -523
- package/dist/esm/structures/Node.js +0 -1600
- package/dist/esm/structures/NodeManager.d.ts +0 -100
- package/dist/esm/structures/NodeManager.js +0 -220
- package/dist/esm/structures/Player.d.ts +0 -223
- package/dist/esm/structures/Player.js +0 -803
- package/dist/esm/structures/Queue.d.ts +0 -186
- package/dist/esm/structures/Queue.js +0 -384
- package/dist/esm/structures/Types/Filters.d.ts +0 -190
- package/dist/esm/structures/Types/Filters.js +0 -1
- package/dist/esm/structures/Types/Manager.d.ts +0 -271
- package/dist/esm/structures/Types/Manager.js +0 -1
- package/dist/esm/structures/Types/Node.d.ts +0 -238
- package/dist/esm/structures/Types/Node.js +0 -1
- package/dist/esm/structures/Types/Player.d.ts +0 -114
- package/dist/esm/structures/Types/Player.js +0 -1
- package/dist/esm/structures/Types/Queue.d.ts +0 -35
- package/dist/esm/structures/Types/Queue.js +0 -1
- package/dist/esm/structures/Types/Track.d.ts +0 -134
- package/dist/esm/structures/Types/Track.js +0 -1
- package/dist/esm/structures/Types/Utils.d.ts +0 -443
- package/dist/esm/structures/Types/Utils.js +0 -1
- package/dist/esm/structures/Utils.d.ts +0 -116
- package/dist/esm/structures/Utils.js +0 -559
- package/dist/types/index.d.ts +0 -16
- package/dist/types/structures/Constants.d.ts +0 -90
- package/dist/types/structures/CustomSearches/BandCampSearch.d.ts +0 -3
- package/dist/types/structures/Filters.d.ts +0 -169
- package/dist/types/structures/LavalinkManager.d.ts +0 -232
- package/dist/types/structures/LavalinkManagerStatics.d.ts +0 -15
- package/dist/types/structures/Node.d.ts +0 -523
- package/dist/types/structures/NodeManager.d.ts +0 -100
- package/dist/types/structures/Player.d.ts +0 -223
- package/dist/types/structures/Queue.d.ts +0 -186
- package/dist/types/structures/Types/Filters.d.ts +0 -190
- package/dist/types/structures/Types/Manager.d.ts +0 -271
- package/dist/types/structures/Types/Node.d.ts +0 -238
- package/dist/types/structures/Types/Player.d.ts +0 -114
- package/dist/types/structures/Types/Queue.d.ts +0 -35
- package/dist/types/structures/Types/Track.d.ts +0 -134
- package/dist/types/structures/Types/Utils.d.ts +0 -443
- package/dist/types/structures/Utils.d.ts +0 -116
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "events";
|
|
2
|
-
import { NodeManager } from "./NodeManager.js";
|
|
3
|
-
import { Player } from "./Player.js";
|
|
4
|
-
import { ManagerUtils, MiniMap } from "./Utils.js";
|
|
5
|
-
import type { ChannelDeletePacket, VoicePacket, VoiceServer, VoiceState } from "./Types/Utils.js";
|
|
6
|
-
import type { BotClientOptions, LavalinkManagerEvents, ManagerOptions } from "./Types/Manager.js";
|
|
7
|
-
import type { PlayerOptions } from "./Types/Player.js";
|
|
8
|
-
export declare class LavalinkManager extends EventEmitter {
|
|
9
|
-
/**
|
|
10
|
-
* Emit an event
|
|
11
|
-
* @param event The event to emit
|
|
12
|
-
* @param args The arguments to pass to the event
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
emit<Event extends keyof LavalinkManagerEvents>(event: Event, ...args: Parameters<LavalinkManagerEvents[Event]>): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Add an event listener
|
|
18
|
-
* @param event The event to listen to
|
|
19
|
-
* @param listener The listener to add
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
on<Event extends keyof LavalinkManagerEvents>(event: Event, listener: LavalinkManagerEvents[Event]): this;
|
|
23
|
-
/**
|
|
24
|
-
* Add an event listener that only fires once
|
|
25
|
-
* @param event The event to listen to
|
|
26
|
-
* @param listener The listener to add
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
once<Event extends keyof LavalinkManagerEvents>(event: Event, listener: LavalinkManagerEvents[Event]): this;
|
|
30
|
-
/**
|
|
31
|
-
* Remove an event listener
|
|
32
|
-
* @param event The event to remove the listener from
|
|
33
|
-
* @param listener The listener to remove
|
|
34
|
-
* @returns
|
|
35
|
-
*/
|
|
36
|
-
off<Event extends keyof LavalinkManagerEvents>(event: Event, listener: LavalinkManagerEvents[Event]): this;
|
|
37
|
-
/**
|
|
38
|
-
* Remove an event listener
|
|
39
|
-
* @param event The event to remove the listener from
|
|
40
|
-
* @param listener The listener to remove
|
|
41
|
-
* @returns
|
|
42
|
-
*/
|
|
43
|
-
removeListener<Event extends keyof LavalinkManagerEvents>(event: Event, listener: LavalinkManagerEvents[Event]): this;
|
|
44
|
-
/** The Options of LavalinkManager (changeable) */
|
|
45
|
-
options: ManagerOptions;
|
|
46
|
-
/** LavalinkManager's NodeManager to manage all Nodes */
|
|
47
|
-
nodeManager: NodeManager;
|
|
48
|
-
/** LavalinkManager's Utils Class */
|
|
49
|
-
utils: ManagerUtils;
|
|
50
|
-
/** Wether the manager was initiated or not */
|
|
51
|
-
initiated: boolean;
|
|
52
|
-
/** All Players stored in a MiniMap */
|
|
53
|
-
readonly players: MiniMap<string, Player>;
|
|
54
|
-
/**
|
|
55
|
-
* Applies the options provided by the User
|
|
56
|
-
* @param options
|
|
57
|
-
* @returns
|
|
58
|
-
*/
|
|
59
|
-
private applyOptions;
|
|
60
|
-
/**
|
|
61
|
-
* Validates the current manager's options
|
|
62
|
-
* @param options
|
|
63
|
-
*/
|
|
64
|
-
private validateOptions;
|
|
65
|
-
/**
|
|
66
|
-
* Create the Lavalink Manager
|
|
67
|
-
* @param options
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```ts
|
|
71
|
-
* //const client = new Client({...}); // create your BOT Client (e.g. via discord.js)
|
|
72
|
-
* client.lavalink = new LavalinkManager({
|
|
73
|
-
* nodes: [
|
|
74
|
-
* {
|
|
75
|
-
* authorization: "yourverystrongpassword",
|
|
76
|
-
* host: "localhost",
|
|
77
|
-
* port: 2333,
|
|
78
|
-
* id: "testnode"
|
|
79
|
-
* },
|
|
80
|
-
* sendToShard(guildId, payload) => client.guilds.cache.get(guildId)?.shard?.send(payload),
|
|
81
|
-
* client: {
|
|
82
|
-
* id: process.env.CLIENT_ID,
|
|
83
|
-
* username: "TESTBOT"
|
|
84
|
-
* },
|
|
85
|
-
* // optional Options:
|
|
86
|
-
* autoSkip: true,
|
|
87
|
-
* playerOptions: {
|
|
88
|
-
* applyVolumeAsFilter: false,
|
|
89
|
-
* clientBasedPositionUpdateInterval: 150,
|
|
90
|
-
* defaultSearchPlatform: "ytmsearch",
|
|
91
|
-
* volumeDecrementer: 0.75,
|
|
92
|
-
* //requesterTransformer: YourRequesterTransformerFunction,
|
|
93
|
-
* onDisconnect: {
|
|
94
|
-
* autoReconnect: true,
|
|
95
|
-
* destroyPlayer: false
|
|
96
|
-
* },
|
|
97
|
-
* onEmptyQueue: {
|
|
98
|
-
* destroyAfterMs: 30_000,
|
|
99
|
-
* //autoPlayFunction: YourAutoplayFunction,
|
|
100
|
-
* },
|
|
101
|
-
* useUnresolvedData: true
|
|
102
|
-
* },
|
|
103
|
-
* queueOptions: {
|
|
104
|
-
* maxPreviousTracks: 25,
|
|
105
|
-
* //queueStore: yourCustomQueueStoreManagerClass,
|
|
106
|
-
* //queueChangesWatcher: yourCustomQueueChangesWatcherClass
|
|
107
|
-
* },
|
|
108
|
-
* linksBlacklist: [],
|
|
109
|
-
* linksWhitelist: [],
|
|
110
|
-
* advancedOptions: {
|
|
111
|
-
* maxFilterFixDuration: 600_000,
|
|
112
|
-
* debugOptions: {
|
|
113
|
-
* noAudio: false,
|
|
114
|
-
* playerDestroy: {
|
|
115
|
-
* dontThrowError: false,
|
|
116
|
-
* debugLogs: false
|
|
117
|
-
* }
|
|
118
|
-
* }
|
|
119
|
-
* }
|
|
120
|
-
* ]
|
|
121
|
-
* })
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
124
|
-
constructor(options: ManagerOptions);
|
|
125
|
-
/**
|
|
126
|
-
* Get a Player from Lava
|
|
127
|
-
* @param guildId The guildId of the player
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* ```ts
|
|
131
|
-
* const player = client.lavalink.getPlayer(interaction.guildId);
|
|
132
|
-
* ```
|
|
133
|
-
* A quicker and easier way than doing:
|
|
134
|
-
* ```ts
|
|
135
|
-
* const player = client.lavalink.players.get(interaction.guildId);
|
|
136
|
-
* ```
|
|
137
|
-
* @returns
|
|
138
|
-
*/
|
|
139
|
-
getPlayer(guildId: string): Player | undefined;
|
|
140
|
-
/**
|
|
141
|
-
* Create a Music-Player. If a player exists, then it returns it before creating a new one
|
|
142
|
-
* @param options
|
|
143
|
-
* @returns
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* ```ts
|
|
147
|
-
* const player = client.lavalink.createPlayer({
|
|
148
|
-
* guildId: interaction.guildId,
|
|
149
|
-
* voiceChannelId: interaction.member.voice.channelId,
|
|
150
|
-
* // everything below is optional
|
|
151
|
-
* textChannelId: interaction.channelId,
|
|
152
|
-
* volume: 100,
|
|
153
|
-
* selfDeaf: true,
|
|
154
|
-
* selfMute: false,
|
|
155
|
-
* instaUpdateFiltersFix: true,
|
|
156
|
-
* applyVolumeAsFilter: false
|
|
157
|
-
* //only needed if you want to autopick node by region (configured by you)
|
|
158
|
-
* // vcRegion: interaction.member.voice.rtcRegion,
|
|
159
|
-
* // provide a specific node
|
|
160
|
-
* // node: client.lavalink.nodeManager.leastUsedNodes("memory")[0]
|
|
161
|
-
* });
|
|
162
|
-
* ```
|
|
163
|
-
*/
|
|
164
|
-
createPlayer(options: PlayerOptions): Player;
|
|
165
|
-
/**
|
|
166
|
-
* Destroy a player with optional destroy reason and disconnect it from the voice channel
|
|
167
|
-
* @param guildId
|
|
168
|
-
* @param destroyReason
|
|
169
|
-
* @returns
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* ```ts
|
|
173
|
-
* client.lavalink.destroyPlayer(interaction.guildId, "forcefully destroyed the player");
|
|
174
|
-
* // recommend to do it on the player tho: player.destroy("forcefully destroyed the player");
|
|
175
|
-
* ```
|
|
176
|
-
*/
|
|
177
|
-
destroyPlayer(guildId: string, destroyReason?: string): Promise<void | Player>;
|
|
178
|
-
/**
|
|
179
|
-
* Delete's a player from the cache without destroying it on lavalink (only works when it's disconnected)
|
|
180
|
-
* @param guildId
|
|
181
|
-
* @returns
|
|
182
|
-
*
|
|
183
|
-
* @example
|
|
184
|
-
* ```ts
|
|
185
|
-
* client.lavalink.deletePlayer(interaction.guildId);
|
|
186
|
-
* // shouldn't be used except you know what you are doing.
|
|
187
|
-
* ```
|
|
188
|
-
*/
|
|
189
|
-
deletePlayer(guildId: string): boolean | void;
|
|
190
|
-
/**
|
|
191
|
-
* Checks wether the the lib is useable based on if any node is connected
|
|
192
|
-
*
|
|
193
|
-
* @example
|
|
194
|
-
* ```ts
|
|
195
|
-
* if(!client.lavalink.useable) return console.error("can'T search yet, because there is no useable lavalink node.")
|
|
196
|
-
* // continue with code e.g. createing a player and searching
|
|
197
|
-
* ```
|
|
198
|
-
*/
|
|
199
|
-
get useable(): boolean;
|
|
200
|
-
/**
|
|
201
|
-
* Initiates the Manager, creates all nodes and connects all of them
|
|
202
|
-
* @param clientData
|
|
203
|
-
*
|
|
204
|
-
* @example
|
|
205
|
-
* ```ts
|
|
206
|
-
* // on the bot ready event
|
|
207
|
-
* client.on("ready", () => {
|
|
208
|
-
* client.lavalink.init({
|
|
209
|
-
* id: client.user.id,
|
|
210
|
-
* username: client.user.username
|
|
211
|
-
* });
|
|
212
|
-
* });
|
|
213
|
-
* ```
|
|
214
|
-
*/
|
|
215
|
-
init(clientData: BotClientOptions): Promise<LavalinkManager>;
|
|
216
|
-
/**
|
|
217
|
-
* Sends voice data to the Lavalink server.
|
|
218
|
-
* ! Without this the library won't work
|
|
219
|
-
* @param data
|
|
220
|
-
*
|
|
221
|
-
* @example
|
|
222
|
-
*
|
|
223
|
-
* ```ts
|
|
224
|
-
* // on the bot "raw" event
|
|
225
|
-
* client.on("raw", (d) => {
|
|
226
|
-
* // required in order to send audio updates and register channel deletion etc.
|
|
227
|
-
* client.lavalink.sendRawData(d)
|
|
228
|
-
* })
|
|
229
|
-
* ```
|
|
230
|
-
*/
|
|
231
|
-
sendRawData(data: VoicePacket | VoiceServer | VoiceState | ChannelDeletePacket): Promise<void>;
|
|
232
|
-
}
|