20 lines
511 B
TypeScript
20 lines
511 B
TypeScript
import { config } from "config";
|
|
import { Routes } from "discord.js";
|
|
import getCommands from "entities/commands";
|
|
import { logger } from "lib/common-logger";
|
|
import { discordRestClient } from "lib/rest-client";
|
|
|
|
export const publishCommands = async () => {
|
|
try {
|
|
await discordRestClient.put(
|
|
Routes.applicationCommands(config.discord.applicationId),
|
|
{
|
|
body: getCommands(),
|
|
},
|
|
);
|
|
logger.info("successfully added commands");
|
|
} catch (e) {
|
|
logger.error("failed to add commands:", e);
|
|
}
|
|
};
|