decord/source/modules/stickers/StickerSendability.tsx
2026-08-05 07:35:12 +00:00

64 lines
2.5 KiB
TypeScript

// Module ID: 5846
// Function ID: 5847
// Name: getStickerSendability
// Dependencies: [1942, 5174, 676, 3901, 4589, 3888, 2]
// Exports: isSendableSticker
// Module 5846 (getStickerSendability)
import trackCommunicationDisabled from "trackCommunicationDisabled";
import parseServerPackSticker from "parseServerPackSticker";
import { Permissions } from "ME";
const require = arg1;
function getStickerSendability(stickerById, trackCommunicationDisabled, channel) {
if (null == trackCommunicationDisabled) {
return obj.NONSENDABLE;
} else {
const result = importDefault(3901).canUseCustomStickersEverywhere(trackCommunicationDisabled);
const obj4 = importDefault(3901);
const tmp22 = require;
if (obj5.isStandardSticker(stickerById)) {
if (null == stickerPack.getStickerPack(stickerById.pack_id)) {
let SENDABLE2 = obj.NONSENDABLE;
} else {
SENDABLE2 = obj.SENDABLE;
}
} else {
if (tmp22Result.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: null, user: null, context: null };
obj[0] = Permissions.USE_EXTERNAL_STICKERS;
obj[1] = trackCommunicationDisabled;
obj[2] = channel;
if (!obj2.can(obj)) {
const NONSENDABLE = obj.NONSENDABLE;
}
obj2 = importAll(3888);
}
} else {
SENDABLE_WITH_BOOSTED_GUILD = obj.SENDABLE_WITH_BOOSTED_GUILD;
}
}
}
return obj.NONSENDABLE;
}
obj5 = require(4589) /* getStickerExtensionFromFormatType */;
}
}
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, channel) {
return getStickerSendability(id, currentUser, channel) === obj.SENDABLE;
};