Add the source code

This commit is contained in:
OptimiDEV
2025-10-09 09:33:35 +02:00
parent 9425a34cb6
commit 30808f2124
19 changed files with 1582 additions and 130 deletions

32
src/deploy-commands.ts Normal file
View File

@@ -0,0 +1,32 @@
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);
});