aboutsummaryrefslogtreecommitdiff
path: root/commands/list.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-04-22 23:01:50 -0400
committerAndrew Lee <alee14498@protonmail.com>2022-04-22 23:01:50 -0400
commit219b64b51b0297469c7a0401767d7f533c8ac7c3 (patch)
tree8fda370a9b32226399ba2a40be17857470c5cca6 /commands/list.js
parenta555449001cbe87503e5ffe9b311aceb59592c63 (diff)
downloadDLAP-219b64b51b0297469c7a0401767d7f533c8ac7c3.tar.gz
DLAP-219b64b51b0297469c7a0401767d7f533c8ac7c3.tar.bz2
DLAP-219b64b51b0297469c7a0401767d7f533c8ac7c3.zip
Buttons can now be disabled from control
Diffstat (limited to 'commands/list.js')
-rw-r--r--commands/list.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/commands/list.js b/commands/list.js
index 2d7c5aa..b95d46d 100644
--- a/commands/list.js
+++ b/commands/list.js
@@ -20,7 +20,7 @@
***************************************************************************/
import { SlashCommandBuilder } from '@discordjs/builders'
-import { readdirSync } from 'fs'
+import { readdirSync, readdir } from 'fs'
const musicFolder = './music';
@@ -32,6 +32,8 @@ export default {
//If someone figures out how to either split the list or make pages when the max character reaches, please do so and make a pull request.
const beats = readdirSync(musicFolder).join('\n');
- await interaction.reply(`Listing the available audio tracks...\n\`\`\`\n${beats}\n\`\`\``);
+ readdir(musicFolder, async (err, files) => {
+ await interaction.reply(`Listing ${files.length} audio tracks...\n\`\`\`\n${beats}\n\`\`\``);
+ });
},
}; \ No newline at end of file