2026-07-27 11:26:19 +00:00
|
|
|
// Module ID: 10996
|
|
|
|
|
// Function ID: 85463
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: _transformClientActionToApiAction
|
2026-07-27 11:26:19 +00:00
|
|
|
// Dependencies: [5, 1838, 3759, 653, 10997, 1327, 21, 507, 10990, 4325, 5746, 686, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: clearMentionRaidDetected, createAutomodRule, deleteAutomodRule, executeAlertAction, fetchAutomodRules, removeMentionRaidRestrictionWithFeedback, updateAutomodRule, validateAutomodRule
|
|
|
|
|
|
2026-07-27 11:26:19 +00:00
|
|
|
// Module 10996 (_transformClientActionToApiAction)
|
2026-07-23 10:11:24 +00:00
|
|
|
import isDiscordFrontendDevelopment from "isDiscordFrontendDevelopment";
|
|
|
|
|
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
|
|
|
|
|
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
|
|
|
|
|
import ME from "ME";
|
|
|
|
|
|
|
|
|
|
let closure_6;
|
|
|
|
|
let closure_7;
|
|
|
|
|
let closure_8;
|
|
|
|
|
const require = arg1;
|
2026-07-20 16:05:17 +00:00
|
|
|
function _transformClientActionToApiAction(type) {
|
2026-07-27 11:26:19 +00:00
|
|
|
const obj = { type: type.type, metadata: require(10997) /* _transformMetadataToCamelCase */._transformMetadataToSnakeCase(type.metadata) };
|
2026-07-20 16:05:17 +00:00
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
function _transformClientRuleToApiRule(id) {
|
2026-07-27 11:26:19 +00:00
|
|
|
let obj = require(10997) /* _transformMetadataToCamelCase */;
|
2026-07-20 16:05:17 +00:00
|
|
|
const result = obj._transformMetadataToSnakeCase(id.triggerMetadata);
|
|
|
|
|
if (null != result) {
|
2026-07-23 10:11:24 +00:00
|
|
|
delete tmp.keywordLists;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
obj = { id: id.id, name: id.name, guild_id: id.guildId, event_type: id.eventType, trigger_type: id.triggerType, trigger_metadata: result };
|
|
|
|
|
const actions = id.actions;
|
2026-07-23 10:11:24 +00:00
|
|
|
const found = actions.filter(require(1327) /* isDiscordFrontendDevelopment */.isNotNullish);
|
2026-07-20 16:05:17 +00:00
|
|
|
obj.actions = found.map(_transformClientActionToApiAction);
|
|
|
|
|
({ enabled: obj2.enabled, creatorId: obj2.creator_id, position: obj2.position } = id);
|
|
|
|
|
let exemptChannels = id.exemptChannels;
|
|
|
|
|
if (null == exemptChannels) {
|
|
|
|
|
exemptChannels = [];
|
|
|
|
|
}
|
|
|
|
|
obj.exempt_channels = Array.from(exemptChannels);
|
|
|
|
|
let exemptRoles = id.exemptRoles;
|
|
|
|
|
if (null == exemptRoles) {
|
|
|
|
|
exemptRoles = [];
|
|
|
|
|
}
|
|
|
|
|
obj.exempt_roles = Array.from(exemptRoles);
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
function _transformApiActionToClientAction(type) {
|
2026-07-27 11:26:19 +00:00
|
|
|
const obj = { type: type.type, metadata: require(10997) /* _transformMetadataToCamelCase */._transformMetadataToCamelCase(type.metadata) };
|
2026-07-20 16:05:17 +00:00
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
function _transformApiRuletoClientRule(id) {
|
|
|
|
|
const obj = {};
|
|
|
|
|
id = id.id;
|
|
|
|
|
if (null == id) {
|
|
|
|
|
const _Date = Date;
|
2026-07-23 10:11:24 +00:00
|
|
|
id = importDefault(21).fromTimestamp(Date.now());
|
|
|
|
|
const obj2 = importDefault(21);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
obj.id = id;
|
|
|
|
|
({ name: obj.name, guild_id: obj.guildId, event_type: obj.eventType, trigger_type: obj.triggerType } = id);
|
2026-07-27 11:26:19 +00:00
|
|
|
obj.triggerMetadata = require(10997) /* _transformMetadataToCamelCase */._transformMetadataToCamelCase(id.trigger_metadata);
|
2026-07-20 16:05:17 +00:00
|
|
|
const actions = id.actions;
|
2026-07-23 10:11:24 +00:00
|
|
|
const found = actions.filter(require(1327) /* isDiscordFrontendDevelopment */.isNotNullish);
|
2026-07-20 16:05:17 +00:00
|
|
|
obj.actions = found.map(_transformApiActionToClientAction);
|
|
|
|
|
({ enabled: obj.enabled, creator_id: obj.creatorId, position: obj.position } = id);
|
|
|
|
|
let exempt_channels = id.exempt_channels;
|
|
|
|
|
if (null == exempt_channels) {
|
|
|
|
|
exempt_channels = [];
|
|
|
|
|
}
|
2026-07-27 11:26:19 +00:00
|
|
|
const obj3 = require(10997) /* _transformMetadataToCamelCase */;
|
2026-07-20 16:05:17 +00:00
|
|
|
obj.exemptChannels = new Set(exempt_channels);
|
|
|
|
|
let exempt_roles = id.exempt_roles;
|
|
|
|
|
if (null == exempt_roles) {
|
|
|
|
|
exempt_roles = [];
|
|
|
|
|
}
|
|
|
|
|
const set = new Set(exempt_channels);
|
|
|
|
|
obj.exemptRoles = new Set(exempt_roles);
|
|
|
|
|
if (null != obj.triggerMetadata) {
|
|
|
|
|
const triggerMetadata = obj.triggerMetadata;
|
2026-07-23 10:11:24 +00:00
|
|
|
delete tmp.keywordLists;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
function _validateAutomodRule() {
|
|
|
|
|
// CreateGeneratorClosureLongIndex (0x67)
|
|
|
|
|
const obj = callback(tmp);
|
|
|
|
|
return obj(...arguments);
|
|
|
|
|
}
|
|
|
|
|
function _createAutomodRule() {
|
|
|
|
|
// CreateGeneratorClosureLongIndex (0x67)
|
|
|
|
|
const obj = callback(tmp);
|
|
|
|
|
return obj(...arguments);
|
|
|
|
|
}
|
|
|
|
|
function _updateAutomodRule() {
|
|
|
|
|
// CreateGeneratorClosureLongIndex (0x67)
|
|
|
|
|
const obj = callback(tmp);
|
|
|
|
|
return obj(...arguments);
|
|
|
|
|
}
|
|
|
|
|
function _deleteAutomodRule() {
|
|
|
|
|
// CreateGeneratorClosureLongIndex (0x67)
|
|
|
|
|
const obj = callback(tmp);
|
|
|
|
|
return obj(...arguments);
|
|
|
|
|
}
|
|
|
|
|
function _fetchAutomodRules() {
|
|
|
|
|
// CreateGeneratorClosureLongIndex (0x67)
|
|
|
|
|
const obj = callback(tmp);
|
|
|
|
|
return obj(...arguments);
|
|
|
|
|
}
|
|
|
|
|
function _executeAlertAction() {
|
|
|
|
|
// CreateGeneratorClosureLongIndex (0x67)
|
|
|
|
|
const obj = callback(tmp);
|
|
|
|
|
return obj(...arguments);
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
({ AnalyticEvents: closure_6, Endpoints: closure_7, Permissions: closure_8 } = ME);
|
|
|
|
|
let result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/guild_automod/GuildAutomodActionCreators.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export const validateAutomodRule = function validateAutomodRule() {
|
|
|
|
|
return _validateAutomodRule(...arguments);
|
|
|
|
|
};
|
|
|
|
|
export const createAutomodRule = function createAutomodRule() {
|
|
|
|
|
return _createAutomodRule(...arguments);
|
|
|
|
|
};
|
|
|
|
|
export const updateAutomodRule = function updateAutomodRule() {
|
|
|
|
|
return _updateAutomodRule(...arguments);
|
|
|
|
|
};
|
|
|
|
|
export const deleteAutomodRule = function deleteAutomodRule() {
|
|
|
|
|
return _deleteAutomodRule(...arguments);
|
|
|
|
|
};
|
|
|
|
|
export const fetchAutomodRules = function fetchAutomodRules(arg0) {
|
|
|
|
|
return _fetchAutomodRules(...arguments);
|
|
|
|
|
};
|
|
|
|
|
export const executeAlertAction = function executeAlertAction(messageId, channel, SUBMIT_FEEDBACK) {
|
|
|
|
|
return _executeAlertAction(...arguments);
|
|
|
|
|
};
|
|
|
|
|
export const removeMentionRaidRestrictionWithFeedback = function removeMentionRaidRestrictionWithFeedback(guildId) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const _require = guildId;
|
|
|
|
|
let closure_1 = arg1;
|
2026-07-20 16:05:17 +00:00
|
|
|
const dependencyMap = arg2;
|
2026-07-23 10:11:24 +00:00
|
|
|
guild = guild.getGuild(guildId);
|
2026-07-20 16:05:17 +00:00
|
|
|
let canResult = null != guild;
|
|
|
|
|
if (canResult) {
|
2026-07-23 10:11:24 +00:00
|
|
|
canResult = _isNativeReflectConstruct.can(constants.MANAGE_GUILD, guild);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
if (canResult) {
|
2026-07-27 11:26:19 +00:00
|
|
|
const result = _require(10990).openConfirmRemoveMentionRaid(() => {
|
2026-07-25 08:10:48 +00:00
|
|
|
let obj = guildId(4325);
|
|
|
|
|
obj = { feedback_type: guildId(5746).Feedback.MENTION_RAID_REMOVE_RESTRICTION, decision_id: closure_1 };
|
2026-07-23 10:11:24 +00:00
|
|
|
obj.trackWithMetadata(outer1_6.GUILD_AUTOMOD_FEEDBACK, obj);
|
|
|
|
|
const HTTP = guildId(507).HTTP;
|
|
|
|
|
obj = { url: outer1_7.GUILD_AUTOMOD_CLEAR_MENTION_RAID(guildId), rejectWithError: true };
|
2026-07-20 16:05:17 +00:00
|
|
|
HTTP.post(obj);
|
2026-07-23 10:11:24 +00:00
|
|
|
dependencyMap();
|
2026-07-20 16:05:17 +00:00
|
|
|
});
|
2026-07-27 11:26:19 +00:00
|
|
|
let obj = _require(10990);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
export const clearMentionRaidDetected = function clearMentionRaidDetected(guildId) {
|
2026-07-23 10:11:24 +00:00
|
|
|
let obj = importDefault(686);
|
2026-07-20 16:05:17 +00:00
|
|
|
obj = { type: "AUTO_MODERATION_MENTION_RAID_NOTICE_DISMISS", guildId };
|
|
|
|
|
obj.dispatch(obj);
|
|
|
|
|
};
|