fix: Change command register type
This commit is contained in:
parent
7d34a2b2dc
commit
fb0f1d80c6
2 changed files with 2 additions and 3 deletions
|
|
@ -8,4 +8,4 @@ export default defineEvent("interactionCreate", async (interaction) => {
|
||||||
if (commandExecuteNameHashMap[interaction.commandName]) {
|
if (commandExecuteNameHashMap[interaction.commandName]) {
|
||||||
await commandExecuteNameHashMap[interaction.commandName](interaction);
|
await commandExecuteNameHashMap[interaction.commandName](interaction);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import { Client, Events, GatewayIntentBits, REST, Routes } from "discord.js";
|
||||||
import { commandMap, DiscordCommand } from "./command";
|
import { commandMap, DiscordCommand } from "./command";
|
||||||
import { eventMap } from "./event";
|
import { eventMap } from "./event";
|
||||||
import { OutputHandler } from "../utils/outputHandler";
|
import { OutputHandler } from "../utils/outputHandler";
|
||||||
import { APPLICATION_ID, GUILD_ID } from "../env";
|
|
||||||
|
|
||||||
export class DiscordBot {
|
export class DiscordBot {
|
||||||
rest: REST;
|
rest: REST;
|
||||||
|
|
@ -25,7 +24,7 @@ export class DiscordBot {
|
||||||
throw new Error("Client is not ready");
|
throw new Error("Client is not ready");
|
||||||
|
|
||||||
await this.rest.put(
|
await this.rest.put(
|
||||||
Routes.applicationGuildCommands(this.client.application.id, GUILD_ID),
|
Routes.applicationCommands(this.client.application.id),
|
||||||
{
|
{
|
||||||
body: commands.map((command) => command.data.toJSON()),
|
body: commands.map((command) => command.data.toJSON()),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue