61 lines
2.4 KiB
TypeScript
61 lines
2.4 KiB
TypeScript
// Module ID: 5732
|
|
// Function ID: 49260
|
|
// Name: getStickerSendability
|
|
// Dependencies: [1917, 5037, 653, 3776, 4466, 3763, 2]
|
|
// Exports: isSendableSticker
|
|
|
|
// Module 5732 (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(3776).canUseCustomStickersEverywhere(currentUser);
|
|
const obj4 = importDefault(3776);
|
|
if (obj5.isStandardSticker(stickerById)) {
|
|
if (null == stickerPack.getStickerPack(stickerById.pack_id)) {
|
|
let SENDABLE2 = obj.NONSENDABLE;
|
|
} else {
|
|
SENDABLE2 = obj.SENDABLE;
|
|
}
|
|
} else {
|
|
obj = require(4466) /* 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(3763);
|
|
}
|
|
} else {
|
|
SENDABLE_WITH_BOOSTED_GUILD = obj.SENDABLE_WITH_BOOSTED_GUILD;
|
|
}
|
|
}
|
|
}
|
|
return obj.NONSENDABLE;
|
|
}
|
|
obj5 = require(4466) /* 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;
|
|
};
|