33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { REST, Routes, SlashCommandBuilder } from 'discord.js';
|
|
import { env } from './config/env.js';
|
|
import * as setup from './commands/setup.js';
|
|
import * as leaderboard from './commands/leaderboard.js';
|
|
import * as profile from './commands/profile.js';
|
|
import * as resetmemory from './commands/resetmemory.js';
|
|
import { banData, kickData, timeoutData } from './commands/moderation.js';
|
|
|
|
async function main() {
|
|
const commands = [
|
|
(setup.data as SlashCommandBuilder).toJSON(),
|
|
(leaderboard.data as SlashCommandBuilder).toJSON(),
|
|
(profile.data as SlashCommandBuilder).toJSON(),
|
|
(resetmemory.data as SlashCommandBuilder).toJSON(),
|
|
banData.toJSON(),
|
|
kickData.toJSON(),
|
|
timeoutData.toJSON()
|
|
];
|
|
|
|
const rest = new REST({ version: '10' }).setToken(env.discordToken);
|
|
|
|
await rest.put(Routes.applicationCommands(env.discordClientId), { body: commands });
|
|
// You can replace with Routes.applicationGuildCommands for quicker iteration per guild
|
|
console.log('Commands deployed.');
|
|
}
|
|
|
|
main().catch((e) => {
|
|
console.error(e);
|
|
process.exit(1);
|
|
});
|
|
|
|
|