Initial commit of karuta-starboard bot
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
const { REST, Routes } = require('discord.js');
|
||||
const fs = require('fs');
|
||||
require('dotenv').config();
|
||||
|
||||
const commands = [];
|
||||
const commandFiles = fs.readdirSync('./SlashCommands').filter(file => file.endsWith('.js'));
|
||||
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`./SlashCommands/${file}`);
|
||||
commands.push(command.data.toJSON());
|
||||
}
|
||||
|
||||
const rest = new REST({ version: '10' }).setToken(process.env.TOKEN);
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
console.log('⏳ Deploying slash commands...');
|
||||
await rest.put(Routes.applicationCommands(process.env.CLIENT_ID), { body: commands });
|
||||
console.log('✅ Commands deployed successfully.');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user