From d7e4cf29e6fc6b8f4ba07e837dcf56b3f5d63afc Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sat, 9 Jul 2022 22:14:38 -0400 Subject: ESLint --- commands/list.js | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'commands/list.js') 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); + } + }); + } +}; -- cgit v1.2.3