decord/source/modules/stickers/StickerSendability.tsx

64 lines
2.4 KiB
TypeScript
Raw Normal View History

// Module ID: 7389
// Function ID: 7390
// Name: StickerSendability
// Dependencies: [2021, 5554, 1074, 4262, 4944, 4248, 2]
2026-07-20 16:05:17 +00:00
// Exports: isSendableSticker
// Module 7389 (StickerSendability)
import PermissionUtilsAll from "PermissionUtils" /* 4248 */;
import PremiumUtilsDefault from "PremiumUtils" /* 4262 */;
import StickersUtils from "StickersUtils" /* 4944 */;
import GuildMemberStore from "GuildMemberStore" /* 2021 */;
import StickersPackStore from "StickersPackStore" /* 5554 */;
2026-07-23 10:11:24 +00:00
require = fn;
function getStickerSendability(stickerById, currentUser, channel) {
if (null == currentUser) {
2026-07-20 16:05:17 +00:00
return obj.NONSENDABLE;
} else {
const result = PremiumUtilsDefault.canUseCustomStickersEverywhere(currentUser);
2026-07-20 16:05:17 +00:00
if (obj5.isStandardSticker(stickerById)) {
if (null == StickersPackStore.getStickerPack(stickerById.pack_id)) {
2026-07-20 16:05:17 +00:00
let SENDABLE2 = obj.NONSENDABLE;
} else {
SENDABLE2 = obj.SENDABLE;
}
} else {
2026-07-29 08:29:29 +00:00
if (tmp22Result.isGuildSticker(stickerById)) {
2026-07-20 16:05:17 +00:00
if (null != channel) {
if (null == GuildMemberStore.getSelfMember(stickerById.guild_id)) {
2026-07-20 16:05:17 +00:00
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 };
2026-07-20 16:05:17 +00:00
if (!obj2.can(obj)) {
const NONSENDABLE = obj.NONSENDABLE;
}
obj2 = PermissionUtilsAll;
2026-07-20 16:05:17 +00:00
}
} else {
SENDABLE_WITH_BOOSTED_GUILD = obj.SENDABLE_WITH_BOOSTED_GUILD;
}
}
}
return obj.NONSENDABLE;
}
obj5 = StickersUtils;
2026-07-20 16:05:17 +00:00
}
}
const Permissions = fn(1074).Permissions;
const StickerSendability = { 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" };
const size = fn(2);
let result = size.fileFinishedImporting("modules/stickers/StickerSendability.tsx");
2026-07-20 16:05:17 +00:00
export { StickerSendability };
2026-07-20 16:05:17 +00:00
export { getStickerSendability };
2026-07-29 08:29:29 +00:00
export const isSendableSticker = function isSendableSticker(id, currentUser, channel) {
return getStickerSendability(id, currentUser, channel) === obj.SENDABLE;
2026-07-20 16:05:17 +00:00
};