Skip to content

Commit be701a7

Browse files
committed
🌟 feat: Remove @discordjs/core
1 parent ee65b16 commit be701a7

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎src/util/deploy.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { API } from '@discordjs/core/http-only';
2-
import { REST, type RESTPutAPIApplicationCommandsResult } from 'discord.js';
1+
import { REST, type RESTPutAPIApplicationCommandsResult, Routes } from 'discord.js';
32
import { commands } from '../commands/index.js';
43
import { config } from '../env.js';
54

65
export async function deployCommands(): Promise<RESTPutAPIApplicationCommandsResult> {
76
const commandData = [...commands.values()].map((command) => command.data);
87

98
const rest = new REST({ version: '10' }).setToken(config.discord.token);
10-
const api = new API(rest);
119

12-
const result = await api.applicationCommands.bulkOverwriteGlobalCommands(
13-
config.discord.clientId,
14-
commandData
15-
);
10+
const result = (await rest.put(
11+
Routes.applicationGuildCommands(config.discord.clientId, config.serverId),
12+
{
13+
body: commandData,
14+
}
15+
)) as RESTPutAPIApplicationCommandsResult;
1616

1717
console.log(`Successfully registered ${result.length} commands.`);
1818
return result;

0 commit comments

Comments
 (0)