aqualink 2.1.1 → 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/build/structures/Aqua.js +12 -0
- package/package.json +1 -1
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);
|