title: How do you disable a button after 5 seconds (discord.js)
body: <p>I'm not very familiar with discord.js buttons and need help disabling a button after 5 seconds to avoid spam but I don't know how. Here is my code:</p>
  <pre class="lang-js prettyprint-override"><code>const newEmbed = new Discord.MessageEmbed()
    .setColor('#2ACAEA')
    .setTitle(&quot;Commands&quot;)
    .setDescription(&quot;Page 1 of 2&quot;)
    .addFields(
      {name: '!jn help', value: 'This command'},
      {name: '!jn ping', value: 'Ping the bot.'},
      {name: '!jn coinflip', value: 'Flip a coin :D'},
      {name: '!jn amiadmin', value: 'Are you an admin? We can see!'}
    )
    .setFooter('Need more help? Join the support discord server.')
    .setImage('https://i.imgur.com/Ta0yst7.png');
  
  const row = new Discord.MessageActionRow()
    .addComponents(
      new Discord.MessageButton()
        .setCustomId('2')
        .setLabel('&gt;&gt;')
        .setStyle('SUCCESS'),
    );
  
  message.channel.send({embeds: [newEmbed], components: [row]});
  
  setTimeout(function () {
    row.components[0].setDisabled(true);
  }, 5000);
  </code></pre>
  <p>When I try, it doesn't output any errors. I think I'm just missing something.
  Can someone help me?</p>