for (const folder of commandFolders) {
//
const commandsPath = path.join(foldersPath, folder);
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("file://" + filePath) as BotCommand;
//Add command to the list
commands.push(command.data.toJSON());
}
}
for (const folder of commandFolders) {
//
const commandsPath = path.join(foldersPath, folder);
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("file://" + filePath) as BotCommand;
//Add command to the list
commands.push(command.data.toJSON());
}
}