Convert to Typescript

This commit is contained in:
2024-09-16 09:56:40 +00:00
parent a89150fc2f
commit 6a59118f4a
42 changed files with 2916 additions and 785 deletions

View File

@@ -0,0 +1,25 @@
import { REST, Routes } from 'discord.js';
import { commands } from './commands';
import config from './config';
// Register all slash commands, globally across all Guilds.
const commandData = Object.values(commands).map(
(command) => command.data.toJSON() as any
);
const rest = new REST().setToken(config.discordApiKey);
try {
console.log('Started refreshing application (/) commands.');
// Refresh all slash commands globally.
rest.put(Routes.applicationCommands(config.discordApplicationId), {
body: commandData,
});
// Exit the process.
process.exit();
} catch (error) {
// And of course, make sure you catch and log any errors!
console.error(error);
}