Search code examples
javascriptdiscorddiscord.jsbots

Unknown Interaction Error in JS Discord Bot


I make a bot about Valorant. I can deploy commands, I can run bot, but when I use command that error appear. These are my code. Pls help me, I dont know where I were wrong and how to fix.index.js deploy_command.js commands/shop.js Error I got

I dont know how to fix, sometime it run sometime error appears. ;-;


Solution

  • You have to use the following code:

    // insert between line 14 and 15 of shop.js
    await interaction.deferReply();
    
    // replace line 32 of shop.js with:
    return interaction.followUp(
    

    This will allow you to have an extra wait time between the moment you receive the interaction and the moment you need to reply it.