diff --git a/src/helpers/discovery/remove_discovery_subcategory.ts b/src/helpers/discovery/remove_discovery_subcategory.ts new file mode 100644 index 000000000..35c508343 --- /dev/null +++ b/src/helpers/discovery/remove_discovery_subcategory.ts @@ -0,0 +1,16 @@ +import { rest } from "../../rest/rest.ts"; +import { endpoints } from "../../util/constants.ts"; +import { requireBotGuildPermissions } from "../../util/permissions.ts"; + +/** Removes a discovery subcategory from the guild. Requires the MANAGE_GUILD permission. Returns a 204 No Content on success. */ +export async function deleteDiscoverySubcategory( + guildId: string, + categoryId: number, +) { + await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]); + + return await rest.runMethod( + "delete", + endpoints.DISCOVERY_SUBCATEGORY(guildId, categoryId), + ); +}