title: How to get the ID of the user who sent the slash command in Discord.js V13
body: <p>Just had a simple question, I have some moderation slash commands on discord bot running on <code>Discord.js V13</code>, and I need to get the user ID of the person who runs the slash command. So I can then check for the permissions of the user on the guild to make sure he has the <code>Ban_Members</code> permission per example. And also how do I get the guild ID of where the slash command was executed</p>
  <p>Thanks! If I wasn't clear feel free to ask me to clarify something</p>
  <p><strong>The code I tried</strong></p>
  <pre><code>client.ws.on(&quot;INTERACTION_CREATE&quot;, async (interaction) =&gt; {
      if (interaction.data.component_type) return;
      const command = interaction.data.name.toLowerCase();
      const args = interaction.data.options;
  
      if (command == &quot;mute&quot;) {
          const guildId = interaction.guildId;
          console.log(guildId);
          // client.api.interactions(interaction.id, interaction.token).callback.post({
          //  data: {
          //      type: 4,
          //      data: {
          //          embeds: [muteembed],
          //          ephemeral: &quot;false&quot;,
          //      },
          //  },
          // });
      }
  });
  </code></pre>
  <p>And I just receive <code>undefined</code> in the console log</p>
  <p><strong>Something else I tried</strong></p>
  <pre><code>client.on(&quot;interactionCreate&quot;, async (interaction) =&gt; {
      if (interaction.data.component_type) return;
      const command = interaction.data.name.toLowerCase();
      const args = interaction.data.options;
  
      if (command == &quot;mute&quot;) {
          const guildId = interaction.guildId;
          console.log(guildId);
          // client.api.interactions(interaction.id, interaction.token).callback.post({
          //  data: {
          //      type: 4,
          //      data: {
          //          embeds: [muteembed],
          //          ephemeral: &quot;false&quot;,
          //      },
          //  },
          // });
      }
  });
  </code></pre>
  <p><strong>And I get this error:</strong></p>
  <pre><code>if (interaction.data.component_type) return;
                               ^
  
  TypeError: Cannot read properties of undefined (reading 'component_type')
  </code></pre>