Hello. I put my commands in a separate folder and file and imported them in the main bot file ((an example of one of the commands I have)):
import { SlashCommandBuilder } from '@discordjs/builders';
//create command with slash command builder
const orderCommand = new SlashCommandBuilder()
.setName('order')
.setDescription('order your favorite meals!')
.addStringOption((option) =>
option
.setName('food')
.setDescription("select your favorite food")
.setRequired(true)
.setChoices(
{
name: 'Cake',
value: 'cake',
},
{
name: 'Hamburger',
value: 'hamburger',
},
{
name: 'Pizza',
value: 'pizza',
},
)
)
.addStringOption((option) =>
option
.setName('drink')
.setDescription('select your favorite drink')
.setRequired(true)
.setChoices(
{
name: "Water",
value: "water",
},
{
name: "Coca-cola",
value: "coca-cola",
},
{
name: "Sprite",
value: "sprite",
},
)
);
export default orderCommand.toJSON()
but when running it gives this error:
import { orderCommand } from './commands/ords.js';
^^^^^^^^^^^^
SyntaxError: The requested module './commands/ords.js' does not provide an export named 'orderCommand'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
at async loadESM (node:internal/process/esm_loader:91:5)
at async handleMainPromise (node:internal/modules/run_main:65:12)
can you help me to fix this?