aboutsummaryrefslogtreecommitdiff
path: root/commands/list.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-07-09 22:14:38 -0400
committerAndrew Lee <alee14498@protonmail.com>2022-07-09 22:14:38 -0400
commitd7e4cf29e6fc6b8f4ba07e837dcf56b3f5d63afc (patch)
treea6fd714025ec7fe78bd89d45d7f0fa36bc8f73aa /commands/list.js
parent4c26fbcb7e1674d5ccbb5468a32cd4a2bc2a315b (diff)
downloadDLAP-d7e4cf29e6fc6b8f4ba07e837dcf56b3f5d63afc.tar.gz
DLAP-d7e4cf29e6fc6b8f4ba07e837dcf56b3f5d63afc.tar.bz2
DLAP-d7e4cf29e6fc6b8f4ba07e837dcf56b3f5d63afc.zip
ESLint
Diffstat (limited to 'commands/list.js')
-rw-r--r--commands/list.js31
1 files changed, 18 insertions, 13 deletions
diff --git a/commands/list.js b/commands/list.js
index b95d46d..9d7a7fd 100644
--- a/commands/list.js
+++ b/commands/list.js
@@ -19,21 +19,26 @@
*
***************************************************************************/
-import { SlashCommandBuilder } from '@discordjs/builders'
-import { readdirSync, readdir } from 'fs'
+import { SlashCommandBuilder } from '@discordjs/builders';
+import { readdirSync, readdir } from 'fs';
const musicFolder = './music';
export default {
- data: new SlashCommandBuilder()
- .setName('list')
- .setDescription('Lists the available audio tracks'),
- async execute(interaction) {
- //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.
+ data: new SlashCommandBuilder()
+ .setName('list')
+ .setDescription('Lists the available audio tracks'),
+ async execute (interaction) {
+ // 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');
- readdir(musicFolder, async (err, files) => {
- await interaction.reply(`Listing ${files.length} audio tracks...\n\`\`\`\n${beats}\n\`\`\``);
- });
- },
-}; \ No newline at end of file
+ const beats = readdirSync(musicFolder).join('\n');
+ readdir(musicFolder, async (err, files) => {
+ await interaction.reply(
+ `Listing ${files.length} audio tracks...\n\`\`\`\n${beats}\n\`\`\``
+ );
+ if (err) {
+ console.error(err);
+ }
+ });
+ }
+};