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 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
@@ -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 } }, search: true }) || null;
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) {
@@ -147,7 +147,7 @@ class Rest {
147
147
 
148
148
  if (track.search) {
149
149
  try {
150
- const query = encodeURIComponent(track.encoded.info.title);
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aqualink",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "An Lavalink client, focused in pure performance and features",
5
5
  "main": "build/index.js",
6
6
  "types": "index.d.ts",