Code not working

const { REST, Routes } = require('discord.js');
const BotID = "1172706429157773443";
const token = process.env.Fortune_Haven;
const ServerID = "1191941239692595321";

const rest = new REST({ version: '9' }).setToken(token);

const commands = [
  {
    name: "dropunique",
    description: "Drops an item from the shop",
    options: [
      {
        type: 3,
        name: "assetId",
        description: "Input the assetId of the item you want to spawn",
        required: true,
      },
    ],
  },
];

const slashRegister = async () => {
  try {
    console.log("Started refreshing application (/) commands.");

    await rest.put(
      Routes.applicationGuildCommands(BotID, ServerID),
      {
        body: commands,
      }
    );

    console.log("Successfully reloaded application (/) commands.");
  } catch (error) {
    console.error(error);
  }
};

slashRegister();
Was this page helpful?