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,90 +0,0 @@
|
|
|
1
|
-
import type { AudioOutputs, ChannelMixFilter, EQBand } from "./Types/Filters";
|
|
2
|
-
export declare enum DebugEvents {
|
|
3
|
-
SetSponsorBlock = "SetSponsorBlock",
|
|
4
|
-
DeleteSponsorBlock = "DeleteSponsorBlock",
|
|
5
|
-
TrackEndReplaced = "TrackEndReplaced",
|
|
6
|
-
AutoplayExecution = "AutoplayExecution",
|
|
7
|
-
AutoplayNoSongsAdded = "AutoplayNoSongsAdded",
|
|
8
|
-
AutoplayThresholdSpamLimiter = "AutoplayThresholdSpamLimiter",
|
|
9
|
-
TriggerQueueEmptyInterval = "TriggerQueueEmptyInterval",
|
|
10
|
-
QueueEnded = "QueueEnded",
|
|
11
|
-
TrackStartNewSongsOnly = "TrackStartNewSongsOnly",
|
|
12
|
-
TrackStartNoTrack = "TrackStartNoTrack",
|
|
13
|
-
ResumingFetchingError = "ResumingFetchingError",
|
|
14
|
-
PlayerUpdateNoPlayer = "PlayerUpdateNoPlayer",
|
|
15
|
-
PlayerUpdateFilterFixApply = "PlayerUpdateFilterFixApply",
|
|
16
|
-
PlayerUpdateSuccess = "PlayerUpdateSuccess",
|
|
17
|
-
HeartBeatTriggered = "HeartBeatTriggered",
|
|
18
|
-
NoSocketOnDestroy = "NoSocketOnDestroy",
|
|
19
|
-
SocketTerminateHeartBeatTimeout = "SocketTerminateHeartBeatTimeout",
|
|
20
|
-
TryingConnectWhileConnected = "TryingConnectWhileConnected",
|
|
21
|
-
LavaSearchNothingFound = "LavaSearchNothingFound",
|
|
22
|
-
SearchNothingFound = "SearchNothingFound",
|
|
23
|
-
ValidatingBlacklistLinks = "ValidatingBlacklistLinks",
|
|
24
|
-
ValidatingWhitelistLinks = "ValidatingWhitelistLinks",
|
|
25
|
-
TrackErrorMaxTracksErroredPerTime = "TrackErrorMaxTracksErroredPerTime",
|
|
26
|
-
TrackStuckMaxTracksErroredPerTime = "TrackStuckMaxTracksErroredPerTime",
|
|
27
|
-
PlayerDestroyingSomewhereElse = "PlayerDestroyingSomewhereElse",
|
|
28
|
-
PlayerCreateNodeNotFound = "PlayerCreateNodeNotFound",
|
|
29
|
-
PlayerPlayQueueEmptyTimeoutClear = "PlayerPlayQueueEmptyTimeoutClear",
|
|
30
|
-
PlayerPlayWithTrackReplace = "PlayerPlayWithTrackReplace",
|
|
31
|
-
PlayerPlayUnresolvedTrack = "PlayerPlayUnresolvedTrack",
|
|
32
|
-
PlayerPlayUnresolvedTrackFailed = "PlayerPlayUnresolvedTrackFailed",
|
|
33
|
-
PlayerVolumeAsFilter = "PlayerVolumeAsFilter",
|
|
34
|
-
BandcampSearchLokalEngine = "BandcampSearchLokalEngine",
|
|
35
|
-
PlayerChangeNode = "PlayerChangeNode",
|
|
36
|
-
BuildTrackError = "BuildTrackError",
|
|
37
|
-
TransformRequesterFunctionFailed = "TransformRequesterFunctionFailed",
|
|
38
|
-
GetClosestTrackFailed = "GetClosestTrackFailed",
|
|
39
|
-
PlayerDeleteInsteadOfDestroy = "PlayerDeleteInsteadOfDestroy",
|
|
40
|
-
FailedToConnectToNodes = "FailedToConnectToNodes",
|
|
41
|
-
NoAudioDebug = "NoAudioDebug",
|
|
42
|
-
PlayerAutoReconnect = "PlayerAutoReconnect"
|
|
43
|
-
}
|
|
44
|
-
export declare enum DestroyReasons {
|
|
45
|
-
QueueEmpty = "QueueEmpty",
|
|
46
|
-
NodeDestroy = "NodeDestroy",
|
|
47
|
-
NodeDeleted = "NodeDeleted",
|
|
48
|
-
LavalinkNoVoice = "LavalinkNoVoice",
|
|
49
|
-
NodeReconnectFail = "NodeReconnectFail",
|
|
50
|
-
Disconnected = "Disconnected",
|
|
51
|
-
PlayerReconnectFail = "PlayerReconnectFail",
|
|
52
|
-
PlayerChangeNodeFail = "PlayerChangeNodeFail",
|
|
53
|
-
PlayerChangeNodeFailNoEligibleNode = "PlayerChangeNodeFailNoEligibleNode",
|
|
54
|
-
ChannelDeleted = "ChannelDeleted",
|
|
55
|
-
DisconnectAllNodes = "DisconnectAllNodes",
|
|
56
|
-
ReconnectAllNodes = "ReconnectAllNodes",
|
|
57
|
-
TrackErrorMaxTracksErroredPerTime = "TrackErrorMaxTracksErroredPerTime",
|
|
58
|
-
TrackStuckMaxTracksErroredPerTime = "TrackStuckMaxTracksErroredPerTime"
|
|
59
|
-
}
|
|
60
|
-
export declare enum DisconnectReasons {
|
|
61
|
-
Disconnected = "Disconnected",
|
|
62
|
-
DisconnectAllNodes = "DisconnectAllNodes"
|
|
63
|
-
}
|
|
64
|
-
export declare const validSponsorBlocks: string[];
|
|
65
|
-
/** The audio Outputs Data map declaration */
|
|
66
|
-
export declare const audioOutputsData: Record<AudioOutputs, ChannelMixFilter>;
|
|
67
|
-
export declare const EQList: {
|
|
68
|
-
/** A Bassboost Equalizer, so high it distorts the audio */
|
|
69
|
-
BassboostEarrape: EQBand[];
|
|
70
|
-
/** A High and decent Bassboost Equalizer */
|
|
71
|
-
BassboostHigh: EQBand[];
|
|
72
|
-
/** A decent Bassboost Equalizer */
|
|
73
|
-
BassboostMedium: EQBand[];
|
|
74
|
-
/** A slight Bassboost Equalizer */
|
|
75
|
-
BassboostLow: EQBand[];
|
|
76
|
-
/** Makes the Music slightly "better" */
|
|
77
|
-
BetterMusic: EQBand[];
|
|
78
|
-
/** Makes the Music sound like rock music / sound rock music better */
|
|
79
|
-
Rock: EQBand[];
|
|
80
|
-
/** Makes the Music sound like Classic music / sound Classic music better */
|
|
81
|
-
Classic: EQBand[];
|
|
82
|
-
/** Makes the Music sound like Pop music / sound Pop music better */
|
|
83
|
-
Pop: EQBand[];
|
|
84
|
-
/** Makes the Music sound like Electronic music / sound Electronic music better */
|
|
85
|
-
Electronic: EQBand[];
|
|
86
|
-
/** Boosts all Bands slightly for louder and fuller sound */
|
|
87
|
-
FullSound: EQBand[];
|
|
88
|
-
/** Boosts basses + lower highs for a pro gaming sound */
|
|
89
|
-
Gaming: EQBand[];
|
|
90
|
-
};
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import type { Player } from "./Player";
|
|
2
|
-
import type { AudioOutputs, EQBand, FilterData, PlayerFilters, TimescaleFilter } from "./Types/Filters";
|
|
3
|
-
/**
|
|
4
|
-
* The FilterManager for each player
|
|
5
|
-
*/
|
|
6
|
-
export declare class FilterManager {
|
|
7
|
-
/** The Equalizer bands currently applied to the Lavalink Server */
|
|
8
|
-
equalizerBands: EQBand[];
|
|
9
|
-
/** Private Util for the instaFix Filters option */
|
|
10
|
-
filterUpdatedState: boolean;
|
|
11
|
-
/** All "Active" / "disabled" Player Filters */
|
|
12
|
-
filters: PlayerFilters;
|
|
13
|
-
/** The Filter Data sent to Lavalink, only if the filter is enabled (ofc.) */
|
|
14
|
-
data: FilterData;
|
|
15
|
-
/** The Player assigned to this Filter Manager */
|
|
16
|
-
player: Player;
|
|
17
|
-
/** The Constructor for the FilterManager */
|
|
18
|
-
constructor(player: Player);
|
|
19
|
-
/**
|
|
20
|
-
* Apply Player filters for lavalink filter sending data, if the filter is enabled / not
|
|
21
|
-
*/
|
|
22
|
-
applyPlayerFilters(): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Checks if the filters are correctly stated (active / not-active)
|
|
25
|
-
* @param oldFilterTimescale
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
checkFiltersState(oldFilterTimescale?: Partial<TimescaleFilter>): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Reset all Filters
|
|
31
|
-
*/
|
|
32
|
-
resetFilters(): Promise<PlayerFilters>;
|
|
33
|
-
/**
|
|
34
|
-
* Set the Filter Volume
|
|
35
|
-
* @param volume
|
|
36
|
-
* @returns
|
|
37
|
-
*/
|
|
38
|
-
setVolume(volume: number): Promise<boolean>;
|
|
39
|
-
/**
|
|
40
|
-
* Set the AudioOutput Filter
|
|
41
|
-
* @param type
|
|
42
|
-
* @returns
|
|
43
|
-
*/
|
|
44
|
-
setAudioOutput(type: AudioOutputs): Promise<AudioOutputs>;
|
|
45
|
-
/**
|
|
46
|
-
* Set custom filter.timescale#speed . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
47
|
-
* @param speed
|
|
48
|
-
* @returns
|
|
49
|
-
*/
|
|
50
|
-
setSpeed(speed?: number): Promise<boolean>;
|
|
51
|
-
/**
|
|
52
|
-
* Set custom filter.timescale#pitch . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
53
|
-
* @param speed
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
setPitch(pitch?: number): Promise<boolean>;
|
|
57
|
-
/**
|
|
58
|
-
* Set custom filter.timescale#rate . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
59
|
-
* @param speed
|
|
60
|
-
* @returns
|
|
61
|
-
*/
|
|
62
|
-
setRate(rate?: number): Promise<boolean>;
|
|
63
|
-
/**
|
|
64
|
-
* Enables / Disables the rotation effect, (Optional: provide your Own Data)
|
|
65
|
-
* @param rotationHz
|
|
66
|
-
* @returns
|
|
67
|
-
*/
|
|
68
|
-
toggleRotation(rotationHz?: number): Promise<boolean>;
|
|
69
|
-
/**
|
|
70
|
-
* Enables / Disables the Vibrato effect, (Optional: provide your Own Data)
|
|
71
|
-
* @param frequency
|
|
72
|
-
* @param depth
|
|
73
|
-
* @returns
|
|
74
|
-
*/
|
|
75
|
-
toggleVibrato(frequency?: number, depth?: number): Promise<boolean>;
|
|
76
|
-
/**
|
|
77
|
-
* Enables / Disables the Tremolo effect, (Optional: provide your Own Data)
|
|
78
|
-
* @param frequency
|
|
79
|
-
* @param depth
|
|
80
|
-
* @returns
|
|
81
|
-
*/
|
|
82
|
-
toggleTremolo(frequency?: number, depth?: number): Promise<boolean>;
|
|
83
|
-
/**
|
|
84
|
-
* Enables / Disables the LowPass effect, (Optional: provide your Own Data)
|
|
85
|
-
* @param smoothing
|
|
86
|
-
* @returns
|
|
87
|
-
*/
|
|
88
|
-
toggleLowPass(smoothing?: number): Promise<boolean>;
|
|
89
|
-
lavalinkLavaDspxPlugin: {
|
|
90
|
-
/**
|
|
91
|
-
* Enables / Disables the LowPass effect, (Optional: provide your Own Data)
|
|
92
|
-
* @param boostFactor
|
|
93
|
-
* @param cutoffFrequency
|
|
94
|
-
* @returns
|
|
95
|
-
*/
|
|
96
|
-
toggleLowPass: (boostFactor?: number, cutoffFrequency?: number) => Promise<boolean>;
|
|
97
|
-
/**
|
|
98
|
-
* Enables / Disables the HighPass effect, (Optional: provide your Own Data)
|
|
99
|
-
* @param boostFactor
|
|
100
|
-
* @param cutoffFrequency
|
|
101
|
-
* @returns
|
|
102
|
-
*/
|
|
103
|
-
toggleHighPass: (boostFactor?: number, cutoffFrequency?: number) => Promise<boolean>;
|
|
104
|
-
/**
|
|
105
|
-
* Enables / Disables the Normalization effect.
|
|
106
|
-
* @param {number} [maxAmplitude=0.75] - The maximum amplitude of the audio.
|
|
107
|
-
* @param {boolean} [adaptive=true] - Whether to use adaptive normalization or not.
|
|
108
|
-
* @returns {Promise<boolean>} - The state of the filter after execution.
|
|
109
|
-
*/
|
|
110
|
-
toggleNormalization: (maxAmplitude?: number, adaptive?: boolean) => Promise<boolean>;
|
|
111
|
-
/**
|
|
112
|
-
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
113
|
-
* @param {number} [decay=0.5] - The decay of the echo effect.
|
|
114
|
-
* @param {number} [echoLength=0.5] - The length of the echo effect.
|
|
115
|
-
* @returns {Promise<boolean>} - The state of the filter after execution.
|
|
116
|
-
*/
|
|
117
|
-
toggleEcho: (decay?: number, echoLength?: number) => Promise<boolean>;
|
|
118
|
-
};
|
|
119
|
-
lavalinkFilterPlugin: {
|
|
120
|
-
/**
|
|
121
|
-
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
122
|
-
* @param delay
|
|
123
|
-
* @param decay
|
|
124
|
-
* @returns
|
|
125
|
-
*/
|
|
126
|
-
toggleEcho: (delay?: number, decay?: number) => Promise<boolean>;
|
|
127
|
-
/**
|
|
128
|
-
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
129
|
-
* @param delays
|
|
130
|
-
* @param gains
|
|
131
|
-
* @returns
|
|
132
|
-
*/
|
|
133
|
-
toggleReverb: (delays?: number[], gains?: number[]) => Promise<boolean>;
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* Enables / Disables a Nightcore-like filter Effect. Disables/Overrides both: custom and Vaporwave Filter
|
|
137
|
-
* @param speed
|
|
138
|
-
* @param pitch
|
|
139
|
-
* @param rate
|
|
140
|
-
* @returns
|
|
141
|
-
*/
|
|
142
|
-
toggleNightcore(speed?: number, pitch?: number, rate?: number): Promise<boolean>;
|
|
143
|
-
/**
|
|
144
|
-
* Enables / Disables a Vaporwave-like filter Effect. Disables/Overrides both: custom and nightcore Filter
|
|
145
|
-
* @param speed
|
|
146
|
-
* @param pitch
|
|
147
|
-
* @param rate
|
|
148
|
-
* @returns
|
|
149
|
-
*/
|
|
150
|
-
toggleVaporwave(speed?: number, pitch?: number, rate?: number): Promise<boolean>;
|
|
151
|
-
/**
|
|
152
|
-
* Enable / Disables a Karaoke like Filter Effect
|
|
153
|
-
* @param level
|
|
154
|
-
* @param monoLevel
|
|
155
|
-
* @param filterBand
|
|
156
|
-
* @param filterWidth
|
|
157
|
-
* @returns
|
|
158
|
-
*/
|
|
159
|
-
toggleKaraoke(level?: number, monoLevel?: number, filterBand?: number, filterWidth?: number): Promise<boolean>;
|
|
160
|
-
/** Function to find out if currently there is a custom timescamle etc. filter applied */
|
|
161
|
-
isCustomFilterActive(): boolean;
|
|
162
|
-
/**
|
|
163
|
-
* Sets the players equalizer band on-top of the existing ones.
|
|
164
|
-
* @param bands
|
|
165
|
-
*/
|
|
166
|
-
setEQ(bands: EQBand | EQBand[]): Promise<this>;
|
|
167
|
-
/** Clears the equalizer bands. */
|
|
168
|
-
clearEQ(): Promise<this>;
|
|
169
|
-
}
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "events";
|
|
2
|
-
import { NodeManager } from "./NodeManager";
|
|
3
|
-
import { Player } from "./Player";
|
|
4
|
-
import { ManagerUtils, MiniMap } from "./Utils";
|
|
5
|
-
import type { ChannelDeletePacket, VoicePacket, VoiceServer, VoiceState } from "./Types/Utils";
|
|
6
|
-
import type { BotClientOptions, LavalinkManagerEvents, ManagerOptions } from "./Types/Manager";
|
|
7
|
-
import type { PlayerOptions } from "./Types/Player";
|
|
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
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ClientCustomSearchPlatformUtils, LavalinkSearchPlatform, SearchPlatform, SourcesRegex } from "./Types/Utils";
|
|
2
|
-
/** Default Sources Record, to allow source parsing with multiple inputs. */
|
|
3
|
-
export declare const DefaultSources: Record<SearchPlatform, LavalinkSearchPlatform | ClientCustomSearchPlatformUtils>;
|
|
4
|
-
/** Lavalink Plugins definiton */
|
|
5
|
-
export declare const LavalinkPlugins: {
|
|
6
|
-
DuncteBot_Plugin: string;
|
|
7
|
-
LavaSrc: string;
|
|
8
|
-
GoogleCloudTTS: string;
|
|
9
|
-
LavaSearch: string;
|
|
10
|
-
Jiosaavn_Plugin: string;
|
|
11
|
-
LavalinkFilterPlugin: string;
|
|
12
|
-
JavaTimedLyricsPlugin: string;
|
|
13
|
-
};
|
|
14
|
-
/** Lavalink Sources regexes for url validations */
|
|
15
|
-
export declare const SourceLinksRegexes: Record<SourcesRegex, RegExp>;
|