lavalink-client 1.0.0 → 1.0.2
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 +103 -152
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/structures/Filters.d.ts +231 -0
- package/dist/cjs/structures/Filters.js +481 -0
- package/dist/cjs/structures/LavalinkManager.d.ts +124 -0
- package/dist/cjs/structures/LavalinkManager.js +168 -0
- package/dist/cjs/structures/LavalinkManagerStatics.d.ts +3 -0
- package/dist/cjs/structures/LavalinkManagerStatics.js +84 -0
- package/dist/cjs/structures/Node.d.ts +245 -0
- package/dist/cjs/structures/Node.js +602 -0
- package/dist/cjs/structures/NodeManager.d.ts +61 -0
- package/dist/cjs/structures/NodeManager.js +35 -0
- package/dist/cjs/structures/Player.d.ts +191 -0
- package/dist/cjs/structures/Player.js +395 -0
- package/dist/cjs/structures/Queue.d.ts +107 -0
- package/dist/cjs/structures/Queue.js +215 -0
- package/dist/cjs/structures/Track.d.ts +47 -0
- package/dist/cjs/structures/Track.js +2 -0
- package/dist/cjs/structures/Utils.d.ts +258 -0
- package/dist/cjs/structures/Utils.js +179 -0
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/structures/Filters.d.ts +231 -0
- package/dist/esm/structures/Filters.js +477 -0
- package/dist/esm/structures/LavalinkManager.d.ts +124 -0
- package/dist/esm/structures/LavalinkManager.js +164 -0
- package/dist/esm/structures/LavalinkManagerStatics.d.ts +3 -0
- package/dist/esm/structures/LavalinkManagerStatics.js +81 -0
- package/dist/esm/structures/Node.d.ts +245 -0
- package/dist/esm/structures/Node.js +597 -0
- package/dist/esm/structures/NodeManager.d.ts +61 -0
- package/dist/esm/structures/NodeManager.js +31 -0
- package/dist/esm/structures/Player.d.ts +191 -0
- package/dist/esm/structures/Player.js +391 -0
- package/dist/esm/structures/Queue.d.ts +107 -0
- package/dist/esm/structures/Queue.js +208 -0
- package/dist/esm/structures/Track.d.ts +47 -0
- package/dist/esm/structures/Track.js +1 -0
- package/dist/esm/structures/Utils.d.ts +258 -0
- package/dist/esm/structures/Utils.js +173 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +13 -0
- package/dist/structures/Filters.d.ts +230 -0
- package/dist/structures/Filters.js +472 -0
- package/dist/structures/LavalinkManager.d.ts +47 -0
- package/dist/structures/LavalinkManager.js +36 -0
- package/dist/structures/LavalinkManagerStatics.d.ts +3 -0
- package/dist/structures/LavalinkManagerStatics.js +76 -0
- package/dist/structures/Node.d.ts +171 -0
- package/dist/structures/Node.js +462 -0
- package/dist/structures/NodeManager.d.ts +58 -0
- package/dist/structures/NodeManager.js +25 -0
- package/dist/structures/Player.d.ts +101 -0
- package/dist/structures/Player.js +232 -0
- package/dist/structures/PlayerManager.d.ts +62 -0
- package/dist/structures/PlayerManager.js +26 -0
- package/dist/structures/Queue.d.ts +93 -0
- package/dist/structures/Queue.js +160 -0
- package/dist/structures/QueueManager.d.ts +77 -0
- package/dist/structures/QueueManager.js +74 -0
- package/dist/structures/Track.d.ts +27 -0
- package/dist/structures/Track.js +2 -0
- package/dist/structures/Utils.d.ts +183 -0
- package/dist/structures/Utils.js +43 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/structures/Filters.d.ts +231 -0
- package/dist/types/structures/LavalinkManager.d.ts +124 -0
- package/dist/types/structures/LavalinkManagerStatics.d.ts +3 -0
- package/dist/types/structures/Node.d.ts +245 -0
- package/dist/types/structures/NodeManager.d.ts +61 -0
- package/dist/types/structures/Player.d.ts +191 -0
- package/dist/types/structures/Queue.d.ts +107 -0
- package/dist/types/structures/Track.d.ts +47 -0
- package/dist/types/structures/Utils.d.ts +258 -0
- package/package.json +63 -26
package/README.md
CHANGED
|
@@ -1,187 +1,138 @@
|
|
|
1
1
|
# lavalink-client
|
|
2
2
|
Easy and advanced lavalink client. Use it with lavalink plugins as well as latest lavalink versions
|
|
3
3
|
|
|
4
|
+
# Install
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
- Lavalink is an open-source Discord Queue Manager and Audioplayer, as well as scraper.
|
|
7
|
-
|
|
8
|
-
*Coming soon*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## How to self Host Lavalink
|
|
13
|
-
|
|
14
|
-
<details>
|
|
15
|
-
<summary>
|
|
16
|
-
👉 Click here to see how to self host a Lavalink instance
|
|
17
|
-
</summary>
|
|
18
|
-
|
|
19
|
-
### Requirements - JAVA
|
|
20
|
-
- [v18](https://github.com/Tomato6966/Debian-Cheat-Sheat-Setup/wiki/3.5.7-java-18) - for Lavalink@latest (v3.5+ or rc*)
|
|
21
|
-
- [v13](https://github.com/Tomato6966/Debian-Cheat-Sheat-Setup/wiki/3.5.3-java-13) - for Lavalink v3.3-v3.4
|
|
22
|
-
- [v11](https://github.com/Tomato6966/Debian-Cheat-Sheat-Setup/wiki/3.5.2-java-11) - for all older Versions
|
|
23
|
-
|
|
24
|
-
### Installation
|
|
25
|
-
- First download the [Lavalink executeable File v3.6.2](https://github.com/freyacodes/Lavalink/releases/download/3.6.2/Lavalink.jar): [from the releases page](https://github.com/freyacodes/Lavalink/releases)
|
|
6
|
+
Latest stable Version: (currently, unreleased)
|
|
26
7
|
```
|
|
27
|
-
|
|
8
|
+
npm install --save lavalink-client
|
|
28
9
|
```
|
|
29
|
-
|
|
10
|
+
Dev Version: (Current)
|
|
30
11
|
```
|
|
31
|
-
|
|
12
|
+
npm install tomato6966/lavalink-client
|
|
32
13
|
```
|
|
33
|
-
*Make sure the file-name is equal to: `application.yml` and is in the same Directory as the `Lavalink.jar` file*
|
|
34
|
-
|
|
35
|
-
**NOTE:** If you don't wanna use the spotify plugin, or any other sources Plugin, then remove it from MY EXAMPLE application.yml
|
|
36
|
-
> other wise you'd get errors. as far this is just a note-cheatsheet FOR ME
|
|
37
14
|
|
|
38
|
-
#
|
|
39
|
-
- In the server config Level of the applicatino.yml for `plugins` you can find all plugins and their versions which will be downloaded
|
|
15
|
+
# Features
|
|
40
16
|
|
|
41
|
-
|
|
42
|
-
make sure to edit:
|
|
43
|
-
- **port** to access Lavalink from a different Port
|
|
44
|
-
- **password** so that you have a password
|
|
45
|
-
- **spotify** -> **clientId** & **clientSecret** [get them from here](https://developer.spotify.com/dashboard/applications)
|
|
46
|
-
- **deezer** -> **masterEncryptionKey** [find it out yourself, how to get it](https://github.com/yne/dzr/issues/11)
|
|
47
|
-
- All other values to fit your needs
|
|
48
|
-
|
|
49
|
-
# Start Lavalink
|
|
50
|
-
|
|
51
|
-
in the folder of `Lavalink.jar` and `application.yml` execute the following
|
|
52
|
-
```bash
|
|
53
|
-
java -jar Lavalink.jar
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
# How to start it 24/7 - 2 Methods
|
|
57
|
-
|
|
58
|
-
- pm2:
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
npm i -g pm2; # add pm2 to the system
|
|
62
|
-
pm2 start --name Lavalink --max-memory-restart 4G java -- -jar Lavalink.jar
|
|
63
|
-
```
|
|
17
|
+
- 💯 Lavalink v4 Supported only (with Lavalink Plugins)
|
|
64
18
|
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
apt-get install screen
|
|
68
|
-
screen -t Lavalink -s Lavalink
|
|
69
|
-
java -jar Lavalink # in the screen window:
|
|
19
|
+
- ✅ Player-Destroy Reasons like:
|
|
20
|
+
- Channel got deleted, Player got disconnected...
|
|
70
21
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
# screen -r <ID> to re-enter a screen
|
|
22
|
+
- ✨ Choose able queue stores (maps, collections, redis, databases, ...)
|
|
23
|
+
- You can create your own queueStore, thus make it easy to sync queues accross multiple connections (e.g. dashboard-bot)
|
|
74
24
|
|
|
75
|
-
|
|
25
|
+
- 😍 Included Filter & Equalizer Management
|
|
76
26
|
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
27
|
+
- 👍 Multiple Player Options *for easier use*
|
|
28
|
+
- onDisconnect -> Player Destroy / auto Reconnect
|
|
29
|
+
- onEmptyQueue -> Player Destroy / leave After x Time
|
|
30
|
+
- instaFixFilter -> seek the player after applying a filter, to instantly apply it's effect (only works for little-durational-songs)
|
|
31
|
+
- applyVolumeAsFilter -> instead of using lavalink.volume, it uses lavalink.filters.volume which is much different!
|
|
81
32
|
|
|
33
|
+
- 🛡️ Lavalink Validations
|
|
34
|
+
- It only let's you use the filters / plugins / sources, if Lavalink actually has it enabled
|
|
82
35
|
|
|
83
|
-
|
|
36
|
+
- 🧑💻 Memory friendly and easy style
|
|
37
|
+
- Only the required data is displayed, and the store-way & types match Lavalink#IMPLEMENTATION.md
|
|
84
38
|
|
|
85
|
-
|
|
86
|
-
|
|
39
|
+
- 😘 Automated Handlings
|
|
40
|
+
- Skips the songs, on TrackEnd, TrackStuck, TrackError,
|
|
41
|
+
- Destroys the player on channeldelete
|
|
42
|
+
- Pauses / resumes the player if it get's muted / unmuted (server-wide) [soon]
|
|
43
|
+
- ...
|
|
44
|
+
- 😁 Much much more!
|
|
87
45
|
|
|
88
|
-
|
|
46
|
+
# Documentation
|
|
89
47
|
|
|
90
|
-
|
|
48
|
+
*soon*
|
|
91
49
|
|
|
92
|
-
|
|
93
|
-
# Enable now
|
|
94
|
-
sysctl -w net.ipv6.ip_nonlocal_bind=1
|
|
95
|
-
# Persist for next boot
|
|
96
|
-
echo 'net.ipv6.ip_nonlocal_bind = 1' >> /etc/sysctl.conf
|
|
97
|
-
```
|
|
50
|
+
# How to Use
|
|
98
51
|
|
|
99
|
-
|
|
52
|
+
1. Import the Manager
|
|
100
53
|
|
|
54
|
+
```ts
|
|
55
|
+
import { LavalinkManager } from "lavalink-client"; // Modular JS / Typescript
|
|
101
56
|
```
|
|
102
|
-
ip -6 route replace local 1234:1234:1234::/64 dev lo
|
|
103
|
-
```
|
|
104
|
-
Don't know how to route it with netplan / interfaces? Ask your provider or do:
|
|
105
|
-
```
|
|
106
|
-
ip add add local 1234:1234:1234::/64 dev lo
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Test the config
|
|
110
57
|
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
ping6 google.com
|
|
114
|
-
|
|
115
|
-
# If you have the IPv6 block 1234:1234:1234::/48
|
|
116
|
-
# You should be able to use any of the IPs within that block
|
|
117
|
-
ping6 -I 1234:1234:1234:: -c 2 google.com
|
|
118
|
-
ping6 -I 1234:1234:1234::1 -c 2 google.com
|
|
119
|
-
ping6 -I 1234:1234:1234::2 -c 2 google.com
|
|
120
|
-
ping6 -I 1234:1234:1234:dead:beef:1234:1234 -c 2 google.com
|
|
58
|
+
```js
|
|
59
|
+
const { LavalinkManager } = require("lavalink-client"); // Common Js
|
|
121
60
|
```
|
|
122
61
|
|
|
123
|
-
|
|
62
|
+
2. create the Manager
|
|
124
63
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
64
|
+
```ts
|
|
65
|
+
// Suggest it to extend it to the bot Client
|
|
66
|
+
client.lavalink = new LavalinkManager({
|
|
67
|
+
nodes: [
|
|
68
|
+
{
|
|
69
|
+
authorization: "youshallnotpass",
|
|
70
|
+
host: "localhost",
|
|
71
|
+
port: 2333,
|
|
72
|
+
id: "testnode",
|
|
73
|
+
requestTimeout: 10000,
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
sendToShard: (guildId, payload) => client.guilds.cache.get(guildId)?.shard?.send(payload),
|
|
77
|
+
autoSkip: true,
|
|
78
|
+
client: {
|
|
79
|
+
id: envConfig.clientId,
|
|
80
|
+
username: "TESTBOT",
|
|
81
|
+
shards: "auto"
|
|
82
|
+
},
|
|
83
|
+
playerOptions: {
|
|
84
|
+
applyVolumeAsFilter: false,
|
|
85
|
+
clientBasedUpdateInterval: 50,
|
|
86
|
+
defaultSearchPlatform: "dzsearch",
|
|
87
|
+
volumeDecrementer: 0.7
|
|
88
|
+
},
|
|
89
|
+
queueOptions: {
|
|
90
|
+
maxPreviousTracks: 5
|
|
91
|
+
},
|
|
92
|
+
// queueStore: new myCustomStore(client.redis), // OPTIONAL! 'class myCustomStore extends DefaultQueueStore' --> for custom queue stores, e.g. redis, etc. | default is lavalink-client#MiniMap
|
|
93
|
+
// queueChangesWatcher: new myCustomWatcher(), // OPTIONAL! 'class myCustomWatcher extends QueueChangesWatcher' --> for queue action logs!
|
|
94
|
+
});
|
|
143
95
|
```
|
|
144
96
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
It's findable with: ip addr
|
|
148
|
-
there are multiple, just find the name of the one where your ipv6 Block is in!
|
|
149
|
-
|
|
150
|
-
**NOW START ndppd**
|
|
97
|
+
3. **VERY IMPORTANT!** - Register Voice State updates + initialize the Manager
|
|
151
98
|
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
99
|
+
```ts
|
|
100
|
+
client.on("raw", d => client.lavalink.sendRawData(d)); // for voice state updates!
|
|
101
|
+
client.on("ready", async () => {
|
|
102
|
+
console.log("Discord Bot is ready to be Used!");
|
|
103
|
+
// user.id is required, user.shards (not), user.username (not, but recommended for lavalink stats!)
|
|
104
|
+
await client.lavalink.init({ ...client.user!, shards: "auto" });
|
|
105
|
+
});
|
|
158
106
|
```
|
|
159
107
|
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
wget http://data.vshell.net/files/ndppd-0.2.5.tar.gz
|
|
163
|
-
tar -zxvf ndppd-0.2.5.tar.gz
|
|
164
|
-
cd ndppd-0.2.5
|
|
165
|
-
make
|
|
166
|
-
make install
|
|
167
|
-
```
|
|
108
|
+
4. **Use it!**
|
|
168
109
|
|
|
110
|
+
```ts
|
|
111
|
+
// create player
|
|
112
|
+
const player = await client.lavalink.createPlayer({
|
|
113
|
+
guildId: guild.id, voiceChannelId: voice.id, textChannelId: text.id, // in what guild + channel(s)
|
|
114
|
+
selfDeaf: true, selfMute: false, volume: 100 // configuration(s)
|
|
115
|
+
});
|
|
116
|
+
// connect the player to it's vc
|
|
117
|
+
await player.connect();
|
|
169
118
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
</details>
|
|
119
|
+
const res = await player.search({
|
|
120
|
+
query: `Elton John`, // source: `soundcloud`,
|
|
121
|
+
}, client.user); // search a query (query-search, url search, identifier search, etc.)
|
|
122
|
+
|
|
123
|
+
await player.queue.add(res.tracks); // add 1 track, or an array of tracks
|
|
124
|
+
await player.play(); // you can provide specific track, or let the manager choose the track from the queue!
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Example (typescript)
|
|
128
|
+
|
|
129
|
+
Can be found in the [`/testBot`](https://github.com/Tomato6966/lavalink-client/blob/main/testBot/README.md) Directory
|
|
130
|
+
|
|
131
|
+
It contains the following features:
|
|
184
132
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
133
|
+
- Example Use for `Redis based Queue`
|
|
134
|
+
- Example Use for `Queue Changes Watcher Logger`
|
|
135
|
+
- Example Use for `Filters`, `Audio Output`, `equalizers`
|
|
136
|
+
- How to make an easy, yet advanced `Slash Commands Only Bot`
|
|
137
|
+
- `Slim Memory Usage`
|
|
138
|
+
- `All lavalink-client events` displayments
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./structures/LavalinkManager";
|
|
2
|
+
export * from "./structures/Filters";
|
|
3
|
+
export * from "./structures/LavalinkManagerStatics";
|
|
4
|
+
export * from "./structures/Node";
|
|
5
|
+
export * from "./structures/NodeManager";
|
|
6
|
+
export * from "./structures/Player";
|
|
7
|
+
export * from "./structures/Queue";
|
|
8
|
+
export * from "./structures/Track";
|
|
9
|
+
export * from "./structures/Utils";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./structures/LavalinkManager"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./structures/Filters"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./structures/LavalinkManagerStatics"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./structures/Node"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./structures/NodeManager"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./structures/Player"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./structures/Queue"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./structures/Track"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./structures/Utils"), exports);
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { Player } from "./Player";
|
|
2
|
+
export type AudioOutputs = "mono" | "stereo" | "left" | "right";
|
|
3
|
+
export interface FilterManager {
|
|
4
|
+
player: Player;
|
|
5
|
+
}
|
|
6
|
+
export declare class FilterManager {
|
|
7
|
+
equalizerBands: EQBand[];
|
|
8
|
+
filterUpdatedState: number;
|
|
9
|
+
filters: PlayerFilters;
|
|
10
|
+
data: LavalinkFilterData;
|
|
11
|
+
constructor(player: Player);
|
|
12
|
+
applyPlayerFilters(): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Checks if the filters are correctly stated (active / not-active)
|
|
15
|
+
* @param oldFilterTimescale
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
checkFiltersState(oldFilterTimescale?: Partial<TimescaleFilter>): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Reset all Filters
|
|
21
|
+
*/
|
|
22
|
+
resetFilters(): Promise<PlayerFilters>;
|
|
23
|
+
setVolume(volume: number): Promise<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* Set the AudioOutput Filter
|
|
26
|
+
* @param type
|
|
27
|
+
*/
|
|
28
|
+
setAudioOutput(type: AudioOutputs): Promise<AudioOutputs>;
|
|
29
|
+
/**
|
|
30
|
+
* Set custom filter.timescale#speed . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
31
|
+
* @param speed
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
setSpeed(speed?: number): Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* Set custom filter.timescale#pitch . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
37
|
+
* @param speed
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
setPitch(pitch?: number): Promise<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Set custom filter.timescale#rate . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
43
|
+
* @param speed
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
setRate(rate?: number): Promise<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* Enabels / Disables the rotation effect, (Optional: provide your Own Data)
|
|
49
|
+
* @param rotationHz
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
toggleRotation(rotationHz?: number): Promise<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Enabels / Disables the Vibrato effect, (Optional: provide your Own Data)
|
|
55
|
+
* @param frequency
|
|
56
|
+
* @param depth
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
toggleVibrato(frequency?: number, depth?: number): Promise<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* Enabels / Disables the Tremolo effect, (Optional: provide your Own Data)
|
|
62
|
+
* @param frequency
|
|
63
|
+
* @param depth
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
toggleTremolo(frequency?: number, depth?: number): Promise<boolean>;
|
|
67
|
+
/**
|
|
68
|
+
* Enabels / Disables the LowPass effect, (Optional: provide your Own Data)
|
|
69
|
+
* @param smoothing
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
toggleLowPass(smoothing?: number): Promise<boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* Enabels / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
75
|
+
* @param delay
|
|
76
|
+
* @param decay
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
toggleEcho(delay?: number, decay?: number): Promise<boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* Enabels / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
82
|
+
* @param delay
|
|
83
|
+
* @param decay
|
|
84
|
+
* @returns
|
|
85
|
+
*/
|
|
86
|
+
toggleReverb(delay?: number, decay?: number): Promise<boolean>;
|
|
87
|
+
/**
|
|
88
|
+
* Enables / Disabels a Nightcore-like filter Effect. Disables/Overwrides both: custom and Vaporwave Filter
|
|
89
|
+
* @param speed
|
|
90
|
+
* @param pitch
|
|
91
|
+
* @param rate
|
|
92
|
+
* @returns
|
|
93
|
+
*/
|
|
94
|
+
toggleNightcore(speed?: number, pitch?: number, rate?: number): Promise<boolean>;
|
|
95
|
+
/**
|
|
96
|
+
* Enables / Disabels a Vaporwave-like filter Effect. Disables/Overwrides both: custom and nightcore Filter
|
|
97
|
+
* @param speed
|
|
98
|
+
* @param pitch
|
|
99
|
+
* @param rate
|
|
100
|
+
* @returns
|
|
101
|
+
*/
|
|
102
|
+
toggleVaporwave(speed?: number, pitch?: number, rate?: number): Promise<boolean>;
|
|
103
|
+
/**
|
|
104
|
+
* Enable / Disables a Karaoke like Filter Effect
|
|
105
|
+
* @param level
|
|
106
|
+
* @param monoLevel
|
|
107
|
+
* @param filterBand
|
|
108
|
+
* @param filterWidth
|
|
109
|
+
* @returns
|
|
110
|
+
*/
|
|
111
|
+
toggleKaraoke(level?: number, monoLevel?: number, filterBand?: number, filterWidth?: number): Promise<boolean>;
|
|
112
|
+
/** Function to find out if currently there is a custom timescamle etc. filter applied */
|
|
113
|
+
isCustomFilterActive(): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Sets the players equalizer band on-top of the existing ones.
|
|
116
|
+
* @param bands
|
|
117
|
+
*/
|
|
118
|
+
setEQ(bands: EQBand | EQBand[]): Promise<this>;
|
|
119
|
+
/** Clears the equalizer bands. */
|
|
120
|
+
clearEQ(): Promise<this>;
|
|
121
|
+
}
|
|
122
|
+
export declare const audioOutputsData: {
|
|
123
|
+
mono: {
|
|
124
|
+
leftToLeft: number;
|
|
125
|
+
leftToRight: number;
|
|
126
|
+
rightToLeft: number;
|
|
127
|
+
rightToRight: number;
|
|
128
|
+
};
|
|
129
|
+
stereo: {
|
|
130
|
+
leftToLeft: number;
|
|
131
|
+
leftToRight: number;
|
|
132
|
+
rightToLeft: number;
|
|
133
|
+
rightToRight: number;
|
|
134
|
+
};
|
|
135
|
+
left: {
|
|
136
|
+
leftToLeft: number;
|
|
137
|
+
leftToRight: number;
|
|
138
|
+
rightToLeft: number;
|
|
139
|
+
rightToRight: number;
|
|
140
|
+
};
|
|
141
|
+
right: {
|
|
142
|
+
leftToLeft: number;
|
|
143
|
+
leftToRight: number;
|
|
144
|
+
rightToLeft: number;
|
|
145
|
+
rightToRight: number;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
export interface PlayerFilters {
|
|
149
|
+
/** Sets nightcore to false, and vaporwave to false */
|
|
150
|
+
custom: boolean;
|
|
151
|
+
/** Sets custom to false, and vaporwave to false */
|
|
152
|
+
nightcore: boolean;
|
|
153
|
+
/** Sets custom to false, and nightcore to false */
|
|
154
|
+
vaporwave: boolean;
|
|
155
|
+
/** only with the custom lavalink filter plugin */
|
|
156
|
+
echo: boolean;
|
|
157
|
+
/** only with the custom lavalink filter plugin */
|
|
158
|
+
reverb: boolean;
|
|
159
|
+
rotation: boolean;
|
|
160
|
+
karaoke: boolean;
|
|
161
|
+
tremolo: boolean;
|
|
162
|
+
vibrato: boolean;
|
|
163
|
+
lowPass: boolean;
|
|
164
|
+
/** audio Output (default stereo, mono sounds the fullest and best for not-stereo tracks) */
|
|
165
|
+
audioOutput: AudioOutputs;
|
|
166
|
+
/** Lavalink Volume FILTER (not player Volume, think of it as a gain booster) */
|
|
167
|
+
volume: boolean;
|
|
168
|
+
}
|
|
169
|
+
export interface EQBand {
|
|
170
|
+
band: number;
|
|
171
|
+
gain: number;
|
|
172
|
+
}
|
|
173
|
+
export interface KaraokeFilter {
|
|
174
|
+
level?: number;
|
|
175
|
+
monoLevel?: number;
|
|
176
|
+
filterBand?: number;
|
|
177
|
+
filterWidth?: number;
|
|
178
|
+
}
|
|
179
|
+
export interface TimescaleFilter {
|
|
180
|
+
speed?: number;
|
|
181
|
+
pitch?: number;
|
|
182
|
+
rate?: number;
|
|
183
|
+
}
|
|
184
|
+
export interface FreqFilter {
|
|
185
|
+
frequency?: number;
|
|
186
|
+
depth?: number;
|
|
187
|
+
}
|
|
188
|
+
export interface RotationFilter {
|
|
189
|
+
rotationHz?: number;
|
|
190
|
+
}
|
|
191
|
+
export interface DistortionFilter {
|
|
192
|
+
sinOffset?: number;
|
|
193
|
+
sinScale?: number;
|
|
194
|
+
cosOffset?: number;
|
|
195
|
+
cosScale?: number;
|
|
196
|
+
tanOffset?: number;
|
|
197
|
+
tanScale?: number;
|
|
198
|
+
offset?: number;
|
|
199
|
+
scale?: number;
|
|
200
|
+
}
|
|
201
|
+
export interface ChannelMixFilter {
|
|
202
|
+
leftToLeft?: number;
|
|
203
|
+
leftToRight?: number;
|
|
204
|
+
rightToLeft?: number;
|
|
205
|
+
rightToRight?: number;
|
|
206
|
+
}
|
|
207
|
+
export interface LowPassFilter {
|
|
208
|
+
smoothing?: number;
|
|
209
|
+
}
|
|
210
|
+
export interface EchoFilter {
|
|
211
|
+
delay: number;
|
|
212
|
+
decay: number;
|
|
213
|
+
}
|
|
214
|
+
export interface ReverbFilter {
|
|
215
|
+
delay: number;
|
|
216
|
+
decay: number;
|
|
217
|
+
}
|
|
218
|
+
export interface LavalinkFilterData {
|
|
219
|
+
volume?: number;
|
|
220
|
+
equalizer?: EQBand[];
|
|
221
|
+
karaoke?: KaraokeFilter;
|
|
222
|
+
timescale?: TimescaleFilter;
|
|
223
|
+
tremolo?: FreqFilter;
|
|
224
|
+
vibrato?: FreqFilter;
|
|
225
|
+
rotation?: RotationFilter;
|
|
226
|
+
distortion?: DistortionFilter;
|
|
227
|
+
channelMix?: ChannelMixFilter;
|
|
228
|
+
lowPass?: LowPassFilter;
|
|
229
|
+
echo: EchoFilter;
|
|
230
|
+
reverb: ReverbFilter;
|
|
231
|
+
}
|