ElektraZale
ElektraZale
DDeno
Created by ElektraZale on 10/19/2024 in #help
dynamic import fail
nvm TS community helped me fix
5 replies
DDeno
Created by ElektraZale on 10/19/2024 in #help
dynamic import fail
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());
}
}
}
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());
}
}
}
5 replies
DDeno
Created by ElektraZale on 10/19/2024 in #help
dynamic import fail
code has since now changed, it's still hanging thoo
5 replies
DDeno
Created by ElektraZale on 10/19/2024 in #help
dynamic import fail
No description
5 replies