for await (const folder of Deno.readDir(foldersPath)) { if (folder.isDirectory) { const commandsPath = path.join("./Commands", folder.name); const commandFiles = fs.readdirSync(commandsPath).filter((file) => //Filter any and all files // that end with ts file.endsWith(".ts") ); for (const file of commandFiles) { //Join Commands/x with /file.tx const filePath = path.join(commandsPath, file); //import the command from file // deno-lint-ignore prefer-const let command = await import(`./${filePath}`) as BotCommand; //Add command to the list commands.push(command.data.toJSON()); } }}