title: How do I remove a role with a discord bot after a certain amount of time? (Javascript)
body: <blockquote>
    <p>My code is as follows:</p>
  </blockquote>
  
  <pre><code>async run(message, args)
  {
      if(message.content.split(" ").length === 3 &amp;&amp; message.content.split(" ") 
      [0] == '!suspend' &amp;&amp; message.content.split(" ")[1].startsWith("&lt;") &amp;&amp; 
      message.content.split(" ")[1].endsWith("&gt;"))
      {
          var nab = message.content.split(" ")[1]; // 2nd item in array when text is split by spaces, (ex. `@user`)
          var nabwoo = message.content.split(" ")[2]; //3rd item in array when the text is split by spaces, (ex. `12h`)
          let role = message.guild.roles.find(r =&gt; r.name === "Suspended");
          //nab is the users id
          let member = message.mentions.members.first();
          member.addRole(role);
          message.channel.sendMessage('Done.');
      }
  }
  </code></pre>
  
  <p>My code is supposed to apply a role called <code>'Suspended'</code> to someone after a message like !<code>suspend @user blank.</code> Everything works great, except I'm unsure how to remove a role after a certain amount of time. There is the method <code>member.removeRole(role)</code> but how would I do this automatically after a specified amount of time? I want there to be a 3 command input. <code>!suspend @person timeInHours (with or without units).</code> As I said, I want it done automatically so a user doesn't have to remove the role with a command. I also want to be able to input other commands (basically suspend other people) while the bot is counting the time until the unsuspension. How would I go about doing this? An idea I have is to perhaps check every minute if it's been > x number of minutes since the suspension.</p>