feat: enchance autocompletion & more #103
1 changed files with 6 additions and 2 deletions
|
@ -173,7 +173,7 @@ export default {
|
||||||
|
|
||||||
/* Create a race between a timeout and the search
|
/* Create a race between a timeout and the search
|
||||||
* At the end, Discord will always receive a response */
|
* At the end, Discord will always receive a response */
|
||||||
const tracks = await Promise.race([
|
let tracks = await Promise.race([
|
||||||
delay,
|
delay,
|
||||||
player.search(query, {
|
player.search(query, {
|
||||||
requestedBy: interaction.user,
|
requestedBy: interaction.user,
|
||||||
|
@ -187,7 +187,11 @@ export default {
|
||||||
return [];
|
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(
|
return interaction.respond(
|
||||||
tracks.slice(0, 10).map((t) => ({
|
tracks.slice(0, 10).map((t) => ({
|
||||||
name: t.title,
|
name: t.title,
|
||||||
|
|
Loading…
Reference in a new issue