Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
121 lines
3.8 KiB
TypeScript
121 lines
3.8 KiB
TypeScript
// Module ID: 8043
|
|
// Function ID: 8044
|
|
// Name: AutomodErrorUtils
|
|
// Dependencies: [1957, 1074, 1114, 7936, 2]
|
|
// Exports: getAutomodErrorMessage
|
|
|
|
// Module 8043 (AutomodErrorUtils)
|
|
import util from "util" /* 1114 */;
|
|
import ChannelStore from "ChannelStore" /* 1957 */;
|
|
|
|
require = fn;
|
|
function getAutomodErrorMessageFromErrorResponse(errorResponseBody, id) {
|
|
if (null == errorResponseBody) {
|
|
return null;
|
|
} else {
|
|
({ code, message } = errorResponseBody);
|
|
if (set.has(code)) {
|
|
if (null != message) {
|
|
return message;
|
|
} else if (null == id) {
|
|
return null;
|
|
} else {
|
|
const channel = ChannelStore.getChannel(id);
|
|
let isThreadResult;
|
|
if (channel != null) {
|
|
isThreadResult = channel.isThread();
|
|
}
|
|
if (isThreadResult) {
|
|
const intl3 = util.intl;
|
|
return intl3.string(util.t.DVdG9E);
|
|
} else {
|
|
let isForumPostResult;
|
|
if (channel != null) {
|
|
isForumPostResult = channel.isForumPost();
|
|
}
|
|
if (isForumPostResult) {
|
|
if (code === AbortCodes.AUTOMOD_TITLE_BLOCKED) {
|
|
const intl2 = util.intl;
|
|
return intl2.string(util.t.ipgKDg);
|
|
} else if (code === tmp4.AUTOMOD_MESSAGE_BLOCKED) {
|
|
const intl = util.intl;
|
|
return intl.string(util.t.ipgKDg);
|
|
}
|
|
} else {
|
|
let isForumLikeChannelResult;
|
|
if (channel != null) {
|
|
isForumLikeChannelResult = channel.isForumLikeChannel();
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
function getAutomodErrorMessageFromMessageData(message) {
|
|
const channel = ChannelStore.getChannel(message.message.channelId);
|
|
if (obj2.isMessageDataEdit(message)) {
|
|
const intl4 = tmp(1114).intl;
|
|
let stringResult = intl4.string(tmp(1114).t.bU6o0z);
|
|
} else {
|
|
let isThreadResult;
|
|
if (channel != null) {
|
|
isThreadResult = channel.isThread();
|
|
}
|
|
if (isThreadResult) {
|
|
const intl3 = tmp(1114).intl;
|
|
stringResult = intl3.string(tmp(1114).t.DVdG9E);
|
|
} else {
|
|
let isForumPostResult;
|
|
if (channel != null) {
|
|
isForumPostResult = channel.isForumPost();
|
|
}
|
|
if (!isForumPostResult) {
|
|
let isForumLikeChannelResult;
|
|
if (channel != null) {
|
|
isForumLikeChannelResult = channel.isForumLikeChannel();
|
|
}
|
|
if (!isForumLikeChannelResult) {
|
|
const intl = tmp(1114).intl;
|
|
stringResult = intl.string(tmp(1114).t.zQ69pv);
|
|
}
|
|
}
|
|
const intl2 = tmp(1114).intl;
|
|
stringResult = intl2.string(tmp(1114).t.ipgKDg);
|
|
}
|
|
}
|
|
return stringResult;
|
|
}
|
|
const AbortCodes = fn(1074).AbortCodes;
|
|
class InvalidKeywordError extends Error {
|
|
}
|
|
const prototype = function InvalidRegexPatternError() {
|
|
return HermesBuiltin.applyArguments(new.target, new.target);
|
|
}.prototype;
|
|
class prototype extends Error {
|
|
}
|
|
const items = [, , ];
|
|
({ AUTOMOD_MESSAGE_BLOCKED: arr[0], AUTOMOD_TITLE_BLOCKED: arr[1], AUTOMOD_INVALID_RUST_SERVICE_RESPONSE: arr[2] } = AbortCodes);
|
|
const set = new Set(items);
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/guild_automod/AutomodErrorUtils.tsx");
|
|
|
|
export { InvalidKeywordError };
|
|
export const InvalidRegexPatternError = prototype;
|
|
export const AUTOMOD_ERROR_CODES = set;
|
|
export { getAutomodErrorMessageFromErrorResponse };
|
|
export { getAutomodErrorMessageFromMessageData };
|
|
export const getAutomodErrorMessage = function getAutomodErrorMessage(messageData, errorResponseBody) {
|
|
const tmp = getAutomodErrorMessageFromErrorResponse(errorResponseBody);
|
|
if (null != tmp) {
|
|
return tmp;
|
|
} else if (null == messageData) {
|
|
const intl = util.intl;
|
|
let stringResult = intl.string(util.t.zQ69pv);
|
|
} else {
|
|
stringResult = getAutomodErrorMessageFromMessageData(messageData);
|
|
}
|
|
};
|