Files
discordeno/helpers/guilds/automod/deleteAutomodRule.ts
T
Skillz4Killz 3a5bdce32d feat: helpers support strings in args (#2478)
* fix: helpers support strings in args

* fix: fmt
2022-09-15 20:59:02 -05:00

31 lines
825 B
TypeScript

import { Bot } from "../../../bot.ts";
import { BigString } from "../../../types/shared.ts";
/**
* Deletes an automod rule.
*
* @param bot - The bot instance to use to make the request.
* @param guildId - The ID of the guild to delete the rule from.
* @param ruleId - The ID of the automod rule to delete.
*
* @remarks
* Requires the `MANAGE_GUILD` permission.
*
* Fires an _Auto Moderation Rule Delete_ gateway event.
*
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule}
*/
export async function deleteAutomodRule(
bot: Bot,
guildId: BigString,
ruleId: BigString,
reason?: string,
): Promise<void> {
return await bot.rest.runMethod<void>(
bot.rest,
"DELETE",
bot.constants.routes.AUTOMOD_RULE(guildId, ruleId),
{ reason },
);
}