diff --git a/helpers/guilds/automod/createAutomodRule.ts b/helpers/guilds/automod/createAutomodRule.ts index 3fbbe99f9..5bd2b7d09 100644 --- a/helpers/guilds/automod/createAutomodRule.ts +++ b/helpers/guilds/automod/createAutomodRule.ts @@ -34,6 +34,7 @@ export async function createAutomodRule(bot: Bot, guildId: bigint, options: Crea enabled: options.enabled ?? true, exempt_roles: options.exemptRoles?.map((id) => id.toString()), exempt_channels: options.exemptChannels?.map((id) => id.toString()), + reason: options.reason, }, ); @@ -74,4 +75,6 @@ export interface CreateAutoModerationRuleOptions { exemptRoles?: bigint[]; /** The channel ids that should not be effected by the rule. */ exemptChannels?: bigint[]; + /** The reason to add to the audit logs. */ + reason?: string; } diff --git a/helpers/guilds/automod/deleteAutomodRule.ts b/helpers/guilds/automod/deleteAutomodRule.ts index a69fd6a24..6eb676eef 100644 --- a/helpers/guilds/automod/deleteAutomodRule.ts +++ b/helpers/guilds/automod/deleteAutomodRule.ts @@ -1,10 +1,11 @@ import { Bot } from "../../../bot.ts"; /** Delete a rule currently configured for guild. */ -export async function deleteAutomodRule(bot: Bot, guildId: bigint, ruleId: bigint) { +export async function deleteAutomodRule(bot: Bot, guildId: bigint, ruleId: bigint, reason?: string) { await bot.rest.runMethod( bot.rest, "DELETE", bot.constants.routes.AUTOMOD_RULE(guildId, ruleId), + { reason }, ); } diff --git a/helpers/guilds/automod/editAutomodRule.ts b/helpers/guilds/automod/editAutomodRule.ts index 19f0c588d..c94634579 100644 --- a/helpers/guilds/automod/editAutomodRule.ts +++ b/helpers/guilds/automod/editAutomodRule.ts @@ -32,6 +32,7 @@ export async function editAutomodRule(bot: Bot, guildId: bigint, options: Partia enabled: options.enabled ?? true, exempt_roles: options.exemptRoles?.map((id) => id.toString()), exempt_channels: options.exemptChannels?.map((id) => id.toString()), + reason: options.reason, }, ); @@ -71,4 +72,6 @@ export interface EditAutoModerationRuleOptions { exemptRoles?: bigint[]; /** The channel ids that should not be effected by the rule. */ exemptChannels?: bigint[]; + /** The reason to add to the audit logs. */ + reason?: string; }