diff --git a/backend/src/plugins/Automod/actions/availableActions.ts b/backend/src/plugins/Automod/actions/availableActions.ts index 3f253bc05..b77f39421 100644 --- a/backend/src/plugins/Automod/actions/availableActions.ts +++ b/backend/src/plugins/Automod/actions/availableActions.ts @@ -11,6 +11,7 @@ import { CleanAction } from "./clean"; import { KickAction } from "./kick"; import { LogAction } from "./log"; import { MuteAction } from "./mute"; +import { PauseInvitesAction } from "./pauseInvites"; import { RemoveRolesAction } from "./removeRoles"; import { ReplyAction } from "./reply"; import { SetAntiraidLevelAction } from "./setAntiraidLevel"; @@ -38,6 +39,7 @@ export const availableActions: Record> = { start_thread: StartThreadAction, archive_thread: ArchiveThreadAction, change_perms: ChangePermsAction, + pause_invites: PauseInvitesAction, }; export const AvailableActions = t.type({ @@ -59,4 +61,5 @@ export const AvailableActions = t.type({ start_thread: StartThreadAction.configType, archive_thread: ArchiveThreadAction.configType, change_perms: ChangePermsAction.configType, + pause_invites: PauseInvitesAction.configType, }); diff --git a/backend/src/plugins/Automod/actions/pauseInvites.ts b/backend/src/plugins/Automod/actions/pauseInvites.ts new file mode 100644 index 000000000..1bbea34fa --- /dev/null +++ b/backend/src/plugins/Automod/actions/pauseInvites.ts @@ -0,0 +1,14 @@ +import * as t from "io-ts"; +import { automodAction } from "../helpers"; + +export const PauseInvitesAction = automodAction({ + configType: t.type({ + paused: t.boolean, + }), + + defaultConfig: {}, + + async apply({ pluginData, actionConfig }) { + await pluginData.guild.disableInvites(actionConfig.paused); + }, +});