title: How to delete slash commands in Discord.js v13
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const { glob } = require("glob");
  const { promisify } = require("util");
  const { Client } = require("discord.js");
  const mongoose = require("mongoose");
  
  const globPromise = promisify(glob);
  
  /**
   * @param {Client} portle
   */
  module.exports = async (portle) =&gt; {
      const commandFiles = await globPromise(`${process.cwd()}/commands/**/*.js`);
      commandFiles.map((value) =&gt; {
          const file = require(value);
          const splitted = value.split("/");
          const directory = splitted[splitted.length - 2];
  
          if (file.name) {
              const properties = { directory, ...file };
              portle.commands.set(file.name, properties);
          }
      });
  
      const eventFiles = await globPromise(`${process.cwd()}/events/*.js`);
      eventFiles.map((value) =&gt; require(value));
  
      const slashCommands = await globPromise(
          `${process.cwd()}/slash-cmds/*/*.js`
      );
  
      const arrayOfSlashCommands = [];
      slashCommands.map((value) =&gt; {
          const file = require(value);
          if (!file?.name) return;
          portle.slashCommands.set(file.name, file);
  
          if (["MESSAGE", "USER"].includes(file.type)) delete file.description;
          arrayOfSlashCommands.push(file);
      });
  
      portle.on("ready", async () =&gt; {
          await portle.guilds.cache
              .get("884380331170484244")
              .commands.set(arrayOfSlashCommands);
      });
  
      const mongooseURI = process.env.URI;
      if (!mongooseURI) throw new Error("Unspecified mongoose connection string!");
  
      mongoose.connect(mongooseURI).then(() =&gt; console.log('Connected to mongodb'));
  };</code></pre>
  </div>
  </div>
  </p>
  <p>I just started learning how to make slash commands and when I made one I restarted my bot <a href="https://i.stack.imgur.com/o7Eat.png" rel="noreferrer">Image of my commands</a>, and now one of my slash commands is duplicated. How would I go about deleting the duplicate?</p>
  <p>Command and Event Handler code below, I found on a yt tutorial.</p>