decord/source/modules/stickers/StickerSendability.tsx

68 lines
2.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 7336
// Function ID: 7337
2026-07-20 16:05:17 +00:00
// Name: getStickerSendability
2026-08-24 06:08:38 +00:00
// Dependencies: [1991, 6808, 676, 4042, 4828, 4029, 2]
2026-07-20 16:05:17 +00:00
// Exports: isSendableSticker
2026-08-24 06:08:38 +00:00
// Module 7336 (getStickerSendability)
import applyOverwritesAll from "applyOverwrites" /* 4029 */;
import getPremiumPlanItemDefault from "getPremiumPlanItem" /* 4042 */;
import getStickerExtensionFromFormatType from "getStickerExtensionFromFormatType" /* 4828 */;
import closure_4 from "trackCommunicationDisabled" /* 1991 */;
import closure_5 from "parseServerPackSticker" /* 6808 */;
import { Permissions } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
function getStickerSendability(stickerById, closure_1_3, channel) {
if (null == closure_1_3) {
2026-07-20 16:05:17 +00:00
return obj.NONSENDABLE;
} else {
2026-08-24 06:08:38 +00:00
const result = getPremiumPlanItemDefault.canUseCustomStickersEverywhere(closure_1_3);
const obj4 = getPremiumPlanItemDefault;
2026-07-29 08:29:29 +00:00
const tmp22 = require;
2026-07-20 16:05:17 +00:00
if (obj5.isStandardSticker(stickerById)) {
if (null == stickerPack.getStickerPack(stickerById.pack_id)) {
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 == 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) {
2026-07-29 08:29:29 +00:00
obj = { permission: null, user: null, context: null };
obj[0] = Permissions.USE_EXTERNAL_STICKERS;
2026-08-24 06:08:38 +00:00
obj[1] = closure_1_3;
2026-07-29 08:29:29 +00:00
obj[2] = channel;
2026-07-20 16:05:17 +00:00
if (!obj2.can(obj)) {
const NONSENDABLE = obj.NONSENDABLE;
}
2026-08-24 06:08:38 +00:00
obj2 = applyOverwritesAll;
2026-07-20 16:05:17 +00:00
}
} else {
SENDABLE_WITH_BOOSTED_GUILD = obj.SENDABLE_WITH_BOOSTED_GUILD;
}
}
}
return obj.NONSENDABLE;
}
2026-08-24 06:08:38 +00:00
obj5 = getStickerExtensionFromFormatType;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
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" };
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/stickers/StickerSendability.tsx");
2026-07-20 16:05:17 +00:00
export const StickerSendability = obj;
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
};