Files
discordeno/src/helpers/integrations/delete_integration.ts
T
ayntee 5f1b82a4e8 refactor: remove RequestManager and use runMethod() (#732)
* fix(rest/process_request): use DiscordHTTPResponseCodes

* refactor: remove RequestManager

* refactor: remove RequestManager and use runMethod()
2021-04-02 23:18:51 +04:00

16 lines
536 B
TypeScript

import { rest } from "../../rest/rest.ts";
import { endpoints } from "../../util/constants.ts";
import { requireBotGuildPermissions } from "../../util/permissions.ts";
/** Delete the attached integration object for the guild with this id. Requires MANAGE_GUILD permission. */
export async function deleteIntegration(guildId: string, id: string) {
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
const result = await rest.runMethod(
"delete",
endpoints.GUILD_INTEGRATION(guildId, id),
);
return result;
}