Skip to content

Commit 9007901

Browse files
authored
refactor: replace discordjs/core (#12)
* 🌟 feat: Remove @discordjs/core * 🚧 build: remove @discordjs/core dependency
1 parent e001acf commit 9007901

File tree

3 files changed

+8
-47
lines changed

3 files changed

+8
-47
lines changed

β€Žpackage.jsonβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"license": "MIT",
3434
"packageManager": "pnpm@10.17.1",
3535
"dependencies": {
36-
"@discordjs/core": "^2.2.2",
3736
"discord.js": "^14.22.1",
3837
"web-features": "^3.3.0"
3938
},

β€Žpnpm-lock.yamlβ€Ž

Lines changed: 1 addition & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ž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)