decord/alpha/source/modules/stickers/StickerSendability.tsx
github-actions 45f5884862 chore: update source for alpha 348.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5012.js (118.4 MB)
2026-09-23 06:49:31 +00:00

63 lines
2.4 KiB
TypeScript

// Module ID: 7665
// Function ID: 7666
// Name: StickerSendability
// Dependencies: [2105, 5807, 1074, 4481, 5188, 4467, 2]
// Exports: isSendableSticker
// Module 7665 (StickerSendability)
import PermissionUtilsAll from "PermissionUtils" /* 4467 */;
import PremiumUtilsDefault from "PremiumUtils" /* 4481 */;
import StickersUtils from "StickersUtils" /* 5188 */;
import GuildMemberStore from "GuildMemberStore" /* 2105 */;
import StickersPackStore from "StickersPackStore" /* 5807 */;
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;
};