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
Was this page helpful?