title: Discord.js -> How do I use the kick command (has it's own file) in index.js in JavaScript
body: <p>so I have this kick command I made in another file with module.exports etc.</p>
  <p>My problem is, how do I run that file in index.js so when I type the command in Discord, that it actually kicks someone.</p>
  <pre><code>module.exports = {
      name: 'kick',
      description: 'Kick a member',
      userPermissions: [&quot;KICK_MEMBERS&quot;],
      options: [
          {
              name: 'target',
              description: 'target to kick',
              type: 'USER',
              required: true
          }, 
          {
              name: 'reason',
              description: 'reason for this kick',
              type: 'STRING',
              required: false
          }
      ],
  
  
      run: async(client, interaction, args) =&gt; {
          const target = interaction.options.getMember('target');
          const reason = 
              interaction.options.getString('reason') || &quot;No reason provided&quot;;
  
          if(
              target.roles.highest.position &gt;= 
              interaction.member.roles.highest.position
              ) 
              
                  return interaction.followUp({ 
                      content: 
                          'You can not take action on this user as their role is heigher than yours',
                  });
  
          await target.send(
              `You have been kicked from ${interaction.guild.name}, reason: ${reason}`
              
              );
  
          target.kick(reason);
  
          interaction.followUp({
              content: `Kicked ${target.user.tag} successfully! reason: ${reason}`,
          });
      },
  }
  </code></pre>
  <p>And this is what I use in order to run it in index.js &lt;-- which doesn't work. It works on ping command etc, but not on ban or kick.</p>
  <pre><code>client.on(&quot;messageCreate&quot;, (message) =&gt; {
      const args = message.content.slice(prefix.length).split(/ +/);
      const command = args.shift().toLowerCase()
  
      if(command == 'help'){
          client.commands.get('help').execute(message)
      }
  
      if(command == 'ping'){
          client.commands.get('ping').execute(message)
      }
  
      if(command == 'kick'){
          client.commands.get('kick').execute(message)
      }
  
      if(command == 'ban'){
          client.commands.get('ban').execute(message)
      }
  })
  </code></pre>
  <p>Could anyone help me with this? I would appreciate it a lot</p>