frazier
frazier
DIAdiscord.js - Imagine an app
Created by frazier on 2/3/2024 in #djs-questions
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();
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();
16 replies