diff --git a/src/commands/build.ts b/src/commands/build.ts index 6fc765b..6f50e23 100644 --- a/src/commands/build.ts +++ b/src/commands/build.ts @@ -168,16 +168,15 @@ export async function build(options: Record) { if(commandsPaths.length === 0) { throw Error("No modules found. Stopping building.") } - const fst = commandsPaths.shift()! const importedModulesTemplate = template .replace("\"use modules\";", commandsImports.join("\n")) .replace("\"use handle\";", ` ${commandsPaths.map((imp, i) => { if(i === 0) { - return `if(interaction.data.name === "${p.parse(fst).name}") { - const success = await applyPlugins(${p.parse(fst).name}); + return `if(interaction.data.name === "${p.parse(imp).name}") { + const success = await applyPlugins(${p.parse(imp).name}); if(success) { - await ${p.parse(fst).name}.execute(); + await ${p.parse(imp).name}.execute(); } }` }