problem with interactionCreate

i am receiving this error /Users/macbookdrink/Desktop/Rito Gomes/events/discord/interactionCreate.js:17 command.run(client, interaction); ^ TypeError: command.run is not a function at module.exports (/Users/macbookdrink/Desktop/Rito Gomes/events/discord/interactionCreate.js:17:13) at Client.emit (node:events:514:28) at InteractionCreateAction.handle (/Users/macbookdrink/node_modules/discord.js/src/client/actions/InteractionCreate.js:97:12) at module.exports [as INTERACTION_CREATE] (/Users/macbookdrink/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36) at WebSocketManager.handlePacket (/Users/macbookdrink/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31) at WebSocketManager.<anonymous> (/Users/macbookdrink/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12) at WebSocketManager.emit (/Users/macbookdrink/node_modules/@vladfrangu/async_event_emitter/dist/index.js:282:31) at WebSocketShard.<anonymous> (/Users/macbookdrink/node_modules/@discordjs/ws/dist/index.js:1173:51) at WebSocketShard.emit (/Users/macbookdrink/node_modules/@vladfrangu/async_event_emitter/dist/index.js:282:31) at WebSocketShard.onMessage (/Users/macbookdrink/node_modules/@discordjs/ws/dist/index.js:988:14) Node.js v18.17.1 this is my interactionCreate.js module.exports = (client, interaction) => { // Verifique se nossa interação é um comando de barra if (interaction.isCommand()) { // Obtenha o comando da nossa coleção de comandos de barra const command = client.interactions.get(interaction.commandName); // Se o comando não existir, retorne uma mensagem de erro if (!command) { return interaction.reply({ content: "Algo deu errado. Talvez o comando não esteja registrado?", ephemeral: true }); } // Execute o comando com o cliente e a interação como parâmetros command.run(client, interaction); } } and this is what i am executing https://pastebin.com/UKHd2hnihttps://pastebin.com/UKHd2hni
8 Replies
d.js toolkit
d.js toolkit8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Patrik
Patrik8mo ago
macbookdrink@ /Users/macbookdrink ├─┬ discord-giveaways@6.0.1 │ └── discord.js@14.13.0 deduped ├─┬ discord-handlers@0.0.1 │ └── discord.js@14.13.0 deduped └── discord.js@14.13.0
treble/luna
treble/luna8mo ago
Your command doesnt export a run function
Patrik
Patrik8mo ago
what do you mean? i am newbie on this
treble/luna
treble/luna8mo ago
do you know how to import and export?
Patrik
Patrik8mo ago
i think i don't know
treble/luna
treble/luna8mo ago
Then learn js first please as djs is not for beginners, #rules 3 #resources
Patrik
Patrik8mo ago
i mean i have other .js who register this commands