2024-06-14 18:45:04 +00:00
|
|
|
// dotenv for handling environment variables
|
|
|
|
const dotenv = require('dotenv');
|
|
|
|
dotenv.config();
|
|
|
|
|
|
|
|
const { REST, Routes } = require('discord.js');
|
2024-06-15 12:22:41 +00:00
|
|
|
const { botId } = require('../data/config.json');
|
2024-06-14 18:45:04 +00:00
|
|
|
const token = process.env.TOKEN;
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
console.log(`Token: ...${token.slice(-5)} | Bot ID: ${botId}`);
|
|
|
|
|
|
|
|
const rest = new REST({ version: '10' }).setToken(token);
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
try {
|
|
|
|
console.log('Started clearing global application (/) commands.');
|
|
|
|
|
|
|
|
await rest.put(
|
|
|
|
Routes.applicationCommands(botId),
|
|
|
|
{ body: '' },
|
|
|
|
);
|
|
|
|
|
|
|
|
console.log('Successfully cleared global application (/) commands.');
|
|
|
|
process.exit();
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error);
|
|
|
|
}
|
|
|
|
})();
|