aqualink 2.1.0 → 2.1.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 +1 -1
- package/build/structures/Aqua.js +12 -0
- package/build/structures/Player.js +2 -2
- package/build/structures/Rest.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ This code is based in riffy, but its an 100% Rewrite made from scratch...
|
|
|
23
23
|
- https://github.com/DRSchlaubi/lyrics.kt (?)
|
|
24
24
|
- https://github.com/DuncteBot/java-timed-lyrics (RECOMMENDED)
|
|
25
25
|
|
|
26
|
-
# Tralalero Tralala 2.1.0 Released
|
|
26
|
+
# Tralalero Tralala 2.1.0 Released
|
|
27
27
|
---
|
|
28
28
|
- Improved the `AQUA` module
|
|
29
29
|
- Faster nodes loading
|
package/build/structures/Aqua.js
CHANGED
|
@@ -287,6 +287,18 @@ class Aqua extends EventEmitter {
|
|
|
287
287
|
return player;
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
+
async search(query, requester, source = this.defaultSearchPlatform) {
|
|
291
|
+
if (!query || !requester) return null;
|
|
292
|
+
|
|
293
|
+
try {
|
|
294
|
+
const { tracks } = await this.resolve({ query, source, requester });
|
|
295
|
+
return tracks || null;
|
|
296
|
+
} catch (error) {
|
|
297
|
+
console.error("Search error:", error);
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
290
302
|
cleanupPlayer(player) {
|
|
291
303
|
if (player && this.players.has(player.guildId)) {
|
|
292
304
|
this.players.delete(player.guildId);
|
|
@@ -147,12 +147,12 @@ class Player extends EventEmitter {
|
|
|
147
147
|
|
|
148
148
|
async searchLyrics(query) {
|
|
149
149
|
if (!query) return null;
|
|
150
|
-
return this.nodes.rest.getLyrics({ track: { info: { title: query }
|
|
150
|
+
return this.nodes.rest.getLyrics({ track: { info: { title: query }, search: true } }) || null;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
async lyrics() {
|
|
154
154
|
if (!this.playing) return null;
|
|
155
|
-
return this.nodes.rest.getLyrics({ track: { encoded: this.current.track } }) || null;
|
|
155
|
+
return this.nodes.rest.getLyrics({ track: { encoded: this.current.track, guild_id: this.guildId } }) || null;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
seek(position) {
|
package/build/structures/Rest.js
CHANGED
|
@@ -147,7 +147,7 @@ class Rest {
|
|
|
147
147
|
|
|
148
148
|
if (track.search) {
|
|
149
149
|
try {
|
|
150
|
-
const query = encodeURIComponent(track.
|
|
150
|
+
const query = encodeURIComponent(track.info.title);
|
|
151
151
|
const res = await this.makeRequest("GET", `/${this.version}/lyrics/search?query=${query}&source=genius`);
|
|
152
152
|
if (res) return res;
|
|
153
153
|
} catch (error) {
|