decord/source/modules/welcome_cta/WelcomeCTAUtils.tsx
2026-08-12 06:57:52 +00:00

54 lines
1.9 KiB
TypeScript

// Module ID: 8149
// Function ID: 8150
// Name: pickHelloSticker
// Dependencies: [1922, 8150, 676, 11, 6959, 698, 2]
// Exports: handleWelcomeCtaClicked, pickHelloSticker, pickWelcomeSticker
// Module 8149 (pickHelloSticker)
import mergeGuildAvatar from "mergeGuildAvatar";
import { WELCOME_STICKERS } from "items";
import { AnalyticEvents } from "ME";
const result = require("ME").fileFinishedImporting("modules/welcome_cta/WelcomeCTAUtils.tsx");
export const pickHelloSticker = function pickHelloSticker() {
const currentUser = authStore.getCurrentUser();
let id;
if (currentUser != null) {
id = currentUser.id;
}
let num = 0;
if (null != id) {
num = importDefault(11).extractTimestamp(id);
const obj = importDefault(11);
}
return WELCOME_STICKERS[num % WELCOME_STICKERS.length];
};
export const pickWelcomeSticker = function pickWelcomeSticker(id) {
const currentUser = authStore.getCurrentUser();
id = undefined;
if (currentUser != null) {
id = currentUser.id;
}
let num = 0;
if (null != id) {
num = importDefault(11).extractTimestamp(id);
const obj = importDefault(11);
}
const obj2 = importDefault(11);
return WELCOME_STICKERS[(num + obj2.extractTimestamp(obj2, id)) % WELCOME_STICKERS.length];
};
export const handleWelcomeCtaClicked = function handleWelcomeCtaClicked(messageChannel, message, stickerId) {
let obj = importDefault(6959);
obj = { channel: messageChannel, message, shouldMention: true, showMentionToggle: true };
obj.sendGreetMessage(messageChannel.id, stickerId, importDefault(6959).getSendMessageOptionsForReply(obj));
const obj2 = importDefault(6959);
obj = { is_reply: true, sticker_id: stickerId, target_user: message.author.id, sender: null };
const currentUser = authStore.getCurrentUser();
let id;
if (currentUser != null) {
id = currentUser.id;
}
obj[3] = id;
importDefault(698).track(AnalyticEvents.WELCOME_CTA_CLICKED, obj);
};