#errorssssssssssssss and idk how

11 messages · Page 1 of 1 (latest)

bold dust
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

#

exact discord.js version is 14.6.0

#

exact node.js version is 18.12.1

#
const { clientId, guildId, token } = require('./token.json');
const fs = require('node:fs');

const commands = [];
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
    const command = require(`./commands/${file}`);
    commands.push(command.data.toJSON());
}

const rest = new REST({ version: '10' }).setToken(token);

(async () => {
    try {
        console.log(`Started refreshing ${commands.length} application (/) commands.`);

        const data = await rest.put(
            Routes.applicationGuildCommands(clientId, guildId),
            { body: commands },
        );

        console.log(`Successfully reloaded ${data.length} application (/) commands.`);
    } catch (error) {
        console.error(error);
    }
})();
#

this is deploy-commands.js

#

does anyone know whats wrong?

fresh rose
#

command.data is undefined. one or more of your commands don't have a data property

bold dust
#

that's the problem then, when i add `data: new SlashCommandBuilder() i have to change everything like name description permission and stuff and when I do that it doesn't work either

#

@fresh rose

fresh rose
#

one of your commands does not have a data property. im right here you dont need to ping me

bold dust
#

let me try something else