From 49283ae699344b96289047336535a63dd9944f58 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 8 Aug 2023 22:04:53 +0200 Subject: [PATCH] increase autocompletion list --- src/commands/music/play.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/music/play.ts b/src/commands/music/play.ts index c48489c..34a5bd3 100644 --- a/src/commands/music/play.ts +++ b/src/commands/music/play.ts @@ -173,7 +173,7 @@ export default { /* Create a race between a timeout and the search * At the end, Discord will always receive a response */ - const tracks = await Promise.race([ + let tracks = await Promise.race([ delay, player.search(query, { requestedBy: interaction.user, @@ -187,7 +187,11 @@ export default { return []; }); - // Returns a list of songs with their title + // Slice the list if needed + if (tracks.length > 25) { + tracks = tracks.slice(0, 25); + } + return interaction.respond( tracks.slice(0, 10).map((t) => ({ name: t.title,