aqualink 1.7.0-beta3 → 1.7.0-beta4

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 CHANGED
@@ -19,6 +19,10 @@ This code is based in riffy, but its an 100% Rewrite made from scratch...
19
19
  - Easy player, node, aqua managing
20
20
  - Fast responses from rest and node
21
21
  - Playlist support (My mix playlists, youtube playlists, spotify playlists)
22
+ - Lyrics Support by Lavalink
23
+ - https://github.com/topi314/LavaLyrics (RECOMMENDED)
24
+ - https://github.com/DRSchlaubi/lyrics.kt (?)
25
+ - https://github.com/DuncteBot/java-timed-lyrics (RECOMMENDED)
22
26
 
23
27
  # Docs (Wiki)
24
28
  - https://github.com/ToddyTheNoobDud/AquaLink/wiki
@@ -178,4 +182,4 @@ client.aqua.on("nodeError", (node, error) => {
178
182
  });
179
183
 
180
184
  client.login("Yourtokenhere");
181
- ```
185
+ ```
@@ -105,6 +105,30 @@ class Player extends EventEmitter {
105
105
  return this;
106
106
  }
107
107
 
108
+ async searchLyrics(query) {
109
+ if (!query) return null;
110
+
111
+ const response = await this.nodes.rest.getLyrics({
112
+ track: {
113
+ encoded: { info: { title: query } },
114
+ guild_id: this.guildId,
115
+ search: true
116
+ }
117
+ });
118
+
119
+ return response || null;
120
+ }
121
+ async lyrics() {
122
+ if (!this.playing) return null;
123
+ const response = await this.nodes.rest.getLyrics({
124
+ track: {
125
+ encoded: this.current.track,
126
+ guild_id: this.guildId
127
+ },
128
+ });
129
+ return response || null;
130
+ }
131
+
108
132
  seek(position) {
109
133
  if (!this.playing) return this;
110
134
  const newPosition = this.position + position;
@@ -96,6 +96,16 @@ class Rest {
96
96
  getRoutePlannerAddress(address) {
97
97
  return this.makeRequest("POST", `/${this.version}/routeplanner/free/address`, { address });
98
98
  }
99
+ async getLyrics({ track }) {
100
+ if (track.search) {
101
+ const v2 = await this.makeRequest("GET", `/v4/lyrics/search?query=${track.encoded.info.title}&source=genius`);
102
+ if (v2) {
103
+ return v2;
104
+ }
105
+ }
106
+ const v4 = await this.makeRequest("GET", `/v4/sessions/${this.sessionId}/players/${track.guild_id}/track/lyrics?skipTrackSource=false`);
107
+ return v4;
108
+ }
99
109
  }
100
110
 
101
- module.exports = { Rest };
111
+ module.exports = { Rest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aqualink",
3
- "version": "1.7.0-beta3",
3
+ "version": "1.7.0-beta4",
4
4
  "description": "An Lavalink wrapper, focused in speed, performance, and features, Based in Riffy!",
5
5
  "main": "build/index.js",
6
6
  "scripts": {