27 lines
999 B
JavaScript
27 lines
999 B
JavaScript
import { REST, Routes } 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.toJSON(),
|
|
leaderboard.data.toJSON(),
|
|
profile.data.toJSON(),
|
|
resetmemory.data.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);
|
|
});
|