61 lines
2.4 KiB
TypeScript
61 lines
2.4 KiB
TypeScript
// Module ID: 9559
|
|
// Function ID: 74635
|
|
// Name: getStickerSendability
|
|
// Dependencies: [1918, 5038, 653, 3777, 4467, 3764, 2]
|
|
// Exports: isSendableSticker
|
|
|
|
// Module 9559 (getStickerSendability)
|
|
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
|
|
import closure_5 from "_isNativeReflectConstruct";
|
|
import { Permissions } from "ME";
|
|
|
|
const require = arg1;
|
|
function getStickerSendability(stickerById, currentUser, channel) {
|
|
if (null == currentUser) {
|
|
return obj.NONSENDABLE;
|
|
} else {
|
|
const result = importDefault(3777).canUseCustomStickersEverywhere(currentUser);
|
|
const obj4 = importDefault(3777);
|
|
if (obj5.isStandardSticker(stickerById)) {
|
|
if (null == stickerPack.getStickerPack(stickerById.pack_id)) {
|
|
let SENDABLE2 = obj.NONSENDABLE;
|
|
} else {
|
|
SENDABLE2 = obj.SENDABLE;
|
|
}
|
|
} else {
|
|
obj = require(4467) /* getStickerPackPreviewSticker */;
|
|
if (obj.isGuildSticker(stickerById)) {
|
|
if (null != channel) {
|
|
if (null == selfMember.getSelfMember(stickerById.guild_id)) {
|
|
let SENDABLE_WITH_BOOSTED_GUILD = obj.NONSENDABLE;
|
|
} else if (stickerById.available) {
|
|
if (null != channel.guild_id) {
|
|
if ("" !== channel.guild_id) {
|
|
const SENDABLE = obj.SENDABLE;
|
|
}
|
|
}
|
|
if (null != channel.guild_id) {
|
|
obj = { permission: Permissions.USE_EXTERNAL_STICKERS, user: currentUser, context: channel };
|
|
if (!obj2.can(obj)) {
|
|
const NONSENDABLE = obj.NONSENDABLE;
|
|
}
|
|
obj2 = importAll(3764);
|
|
}
|
|
} else {
|
|
SENDABLE_WITH_BOOSTED_GUILD = obj.SENDABLE_WITH_BOOSTED_GUILD;
|
|
}
|
|
}
|
|
}
|
|
return obj.NONSENDABLE;
|
|
}
|
|
obj5 = require(4467) /* getStickerPackPreviewSticker */;
|
|
}
|
|
}
|
|
let obj = { SENDABLE: 0, [0]: "SENDABLE", SENDABLE_WITH_PREMIUM: 1, [1]: "SENDABLE_WITH_PREMIUM", NONSENDABLE: 2, [2]: "NONSENDABLE", SENDABLE_WITH_BOOSTED_GUILD: 3, [3]: "SENDABLE_WITH_BOOSTED_GUILD" };
|
|
let result = require("ME").fileFinishedImporting("modules/stickers/StickerSendability.tsx");
|
|
|
|
export const StickerSendability = obj;
|
|
export { getStickerSendability };
|
|
export const isSendableSticker = function isSendableSticker(id, currentUser, closure_5) {
|
|
return getStickerSendability(id, currentUser, closure_5) === obj.SENDABLE;
|
|
};
|