decord/stable/source/modules/stickers/StickerSendability.tsx
github-actions 57c2214117 chore: update source for stable 347.12
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
2026-09-29 21:26:22 +00:00

63 lines
2.4 KiB
TypeScript

// Module ID: 7611
// Function ID: 7612
// Name: StickerSendability
// Dependencies: [2105, 5753, 1074, 4446, 5135, 4432, 2]
// Exports: isSendableSticker
// Module 7611 (StickerSendability)
import PermissionUtilsAll from "PermissionUtils" /* 4432 */;
import PremiumUtilsDefault from "PremiumUtils" /* 4446 */;
import StickersUtils from "StickersUtils" /* 5135 */;
import GuildMemberStore from "GuildMemberStore" /* 2105 */;
import StickersPackStore from "StickersPackStore" /* 5753 */;
require = fn;
function getStickerSendability(item10030, currentUser, channel) {
if (null == currentUser) {
return obj.NONSENDABLE;
} else {
const result = PremiumUtilsDefault.canUseCustomStickersEverywhere(currentUser);
if (obj5.isStandardSticker(item10030)) {
if (null == StickersPackStore.getStickerPack(item10030.pack_id)) {
let SENDABLE2 = obj.NONSENDABLE;
} else {
SENDABLE2 = obj.SENDABLE;
}
} else {
if (tmp22Result.isGuildSticker(item10030)) {
if (null != channel) {
if (null == GuildMemberStore.getSelfMember(item10030.guild_id)) {
let SENDABLE_WITH_BOOSTED_GUILD = obj.NONSENDABLE;
} else if (item10030.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 = PermissionUtilsAll;
}
} else {
SENDABLE_WITH_BOOSTED_GUILD = obj.SENDABLE_WITH_BOOSTED_GUILD;
}
}
}
return obj.NONSENDABLE;
}
obj5 = StickersUtils;
}
}
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");
export { StickerSendability };
export { getStickerSendability };
export const isSendableSticker = function isSendableSticker(id, currentUser, channel) {
return getStickerSendability(id, currentUser, channel) === obj.SENDABLE;
};