begin rewriting first services to be domain agnostic
more rewrites
This commit is contained in:
18
adapters/discord/src/actions/publish-commands.ts
Normal file
18
adapters/discord/src/actions/publish-commands.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { config } from "config";
|
||||
import { Routes } from "discord.js";
|
||||
import getCommands from "entitites/commands";
|
||||
import { discordRestClient } from "lib/rest-client";
|
||||
|
||||
export const publishCommands = async () => {
|
||||
try {
|
||||
await discordRestClient.put(
|
||||
Routes.applicationCommands(config.discord.applicationId),
|
||||
{
|
||||
body: getCommands(),
|
||||
},
|
||||
);
|
||||
console.log("Successfully added commands");
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user