The token used for authentication with the Discord API.
The Discord client ID.
The ID of the guild where commands are being deployed.
An array of SlashCommandBuilder representing the commands to be deployed.
A promise that resolves when commands are successfully deployed.
Will throw an error if there is a problem with the deployment.
import { commands } from "./commands";
import { deployCommands } from "@skeet-framework/discord-utils";
import { DISCORD_APPLICATION_ID, DISCORD_GUILD_ID } from "../config";
const commandsData = Object.values(commands).map((command) => command.data);
const run = async () => {
const token = process.argv[2] || '';
try {
await deployCommands(token, DISCORD_APPLICATION_ID, DISCORD_GUILD_ID, commandsData);
console.log('Commands deployed successfully.');
} catch (error) {
console.error(`Error deploying commands: ${error}`);
}
};
run()
.then(() => console.log('Done'))
.catch((error) => console.error(error));
Generated using TypeDoc
Deploys application commands to a specific guild.
This function authenticates with the Discord API using the provided token, then deploys the specified commands to the given guild.