create a SlashCommandBuilder

i tried:
new Discord.SlashCommandBuilder()
  .setName('ping')
  .setDescription('Replies with Pong!');

bot.on('interactionCreate', async (interaction) => {
  if (interaction.isCommand()) {
    if (interaction.commandName === 'ping') {
      await interaction.reply('pong!')
    }
  }
})

but nothing happens, can y'all help me? :(
Was this page helpful?