Files
discordeno/src/helpers/commands/delete_slash_command.ts
2021-04-23 23:27:47 +02:00

17 lines
444 B
TypeScript

import { applicationId } from "../../bot.ts";
import { rest } from "../../rest/rest.ts";
import { endpoints } from "../../util/constants.ts";
/** Deletes a slash command. */
export async function deleteSlashCommand(
id: string,
guildId?: string,
) {
return await rest.runMethod<undefined>(
"delete",
guildId
? endpoints.COMMANDS_GUILD_ID(applicationId, guildId, id)
: endpoints.COMMANDS_ID(applicationId, id),
);
}