decord/source/modules/stickers/StickerSendability.tsx

65 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 5846
// Function ID: 5847
2026-07-20 16:05:17 +00:00
// Name: getStickerSendability
2026-08-05 07:35:12 +00:00
// Dependencies: [1942, 5174, 676, 3901, 4589, 3888, 2]
2026-07-20 16:05:17 +00:00
// Exports: isSendableSticker
2026-08-05 07:35:12 +00:00
// Module 5846 (getStickerSendability)
2026-07-29 08:29:29 +00:00
import trackCommunicationDisabled from "trackCommunicationDisabled";
import parseServerPackSticker from "parseServerPackSticker";
2026-07-23 10:11:24 +00:00
import { Permissions } from "ME";
const require = arg1;
2026-07-29 08:29:29 +00:00
function getStickerSendability(stickerById, trackCommunicationDisabled, channel) {
if (null == trackCommunicationDisabled) {
2026-07-20 16:05:17 +00:00
return obj.NONSENDABLE;
} else {
2026-08-05 07:35:12 +00:00
const result = importDefault(3901).canUseCustomStickersEverywhere(trackCommunicationDisabled);
const obj4 = importDefault(3901);
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;
obj[1] = trackCommunicationDisabled;
obj[2] = channel;
2026-07-20 16:05:17 +00:00
if (!obj2.can(obj)) {
const NONSENDABLE = obj.NONSENDABLE;
}
2026-08-05 07:35:12 +00:00
obj2 = importAll(3888);
2026-07-20 16:05:17 +00:00
}
} else {
SENDABLE_WITH_BOOSTED_GUILD = obj.SENDABLE_WITH_BOOSTED_GUILD;
}
}
}
return obj.NONSENDABLE;
}
2026-08-05 07:35:12 +00:00
obj5 = require(4589) /* 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" };
let result = require("ME").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
};