decord/source/modules/guild_automod/AutomodActionUtils.tsx

37 lines
2.3 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 16378
// Function ID: 16379
// Name: getRuleDefaultActionsFromConfig
// Dependencies: [11053, 2]
// Exports: getDefaultActions, getRuleDefaultActionsFromConfig, isActionBlockMessage, isActionFlagToChannel, isActionQuarantineUser, isActionUserCommunicationDisabled
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 16378 (getRuleDefaultActionsFromConfig)
2026-07-23 10:11:24 +00:00
import { AutomodActionType } from "AutomodEventType";
const result = require("set").fileFinishedImporting("modules/guild_automod/AutomodActionUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getRuleDefaultActionsFromConfig = function getRuleDefaultActionsFromConfig(defaultActionTypes) {
2026-07-29 08:29:29 +00:00
let obj = { type: AutomodActionType.BLOCK_MESSAGE, metadata: { customMessage: "r" } };
obj = { type: AutomodActionType.FLAG_TO_CHANNEL, metadata: { channelId: "r" } };
obj = { type: AutomodActionType.USER_COMMUNICATION_DISABLED, metadata: { durationSeconds: 60 } };
AutomodActionType = { [closure_0.BLOCK_MESSAGE]: obj, [closure_0.FLAG_TO_CHANNEL]: obj, [closure_0.USER_COMMUNICATION_DISABLED]: obj, [closure_0.QUARANTINE_USER]: { type: AutomodActionType.QUARANTINE_USER, metadata: {} } };
2026-07-23 10:11:24 +00:00
return Array.from(defaultActionTypes.defaultActionTypes).map((arg0) => table[arg0]);
2026-07-20 16:05:17 +00:00
};
export const isActionFlagToChannel = function isActionFlagToChannel(type) {
return type.type === AutomodActionType.FLAG_TO_CHANNEL;
};
export const isActionUserCommunicationDisabled = function isActionUserCommunicationDisabled(type) {
return type.type === AutomodActionType.USER_COMMUNICATION_DISABLED;
};
export const isActionBlockMessage = function isActionBlockMessage(type) {
return type.type === AutomodActionType.BLOCK_MESSAGE;
};
export const isActionQuarantineUser = function isActionQuarantineUser(type) {
return type.type === AutomodActionType.QUARANTINE_USER;
};
2026-07-29 08:29:29 +00:00
export const getDefaultActions = function getDefaultActions() {
let obj = { type: AutomodActionType.BLOCK_MESSAGE, metadata: { customMessage: "r" } };
obj = { type: AutomodActionType.FLAG_TO_CHANNEL, metadata: { channelId: "r" } };
obj = { type: AutomodActionType.USER_COMMUNICATION_DISABLED, metadata: { durationSeconds: 60 } };
return { [closure_0.BLOCK_MESSAGE]: obj, [closure_0.FLAG_TO_CHANNEL]: obj, [closure_0.USER_COMMUNICATION_DISABLED]: obj, [closure_0.QUARANTINE_USER]: { type: AutomodActionType.QUARANTINE_USER, metadata: {} } };
};