Skip to content

Commit

Permalink
✨: Start project
Browse files Browse the repository at this point in the history
  • Loading branch information
RadNotRed committed Sep 23, 2023
1 parent 21fd56a commit e7478b4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/commands.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';

import { REST, Routes } from 'discord.js';
import 'dotenv/config';

const commands = JSON.parse(
await readFile(join(process.cwd(), 'commands.json'), 'utf-8')
);

const rest = new REST({ version: '10' }).setToken(process.env.TOKEN);

await rest.put(
Routes.applicationCommands(process.env.CLIENT_ID),
{ body: commands }
);

console.log('Successfully reloaded application (/) commands.');

0 comments on commit e7478b4

Please sign in to comment.