decord/source/modules/guild_profile/GuildProfileUtils.tsx

60 lines
1.8 KiB
TypeScript
Raw Normal View History

// Module ID: 7851
// Function ID: 7852
// Name: GuildProfileUtils
// Dependencies: [1962, 1074, 1972, 2]
2026-07-20 16:05:17 +00:00
// Exports: getEstablishedDate, guildInviteCanEmbedProfile
// Module 7851 (GuildProfileUtils)
import Constants from "Constants" /* 1074 */;
import ChannelRecord from "ChannelRecord" /* 1962 */;
import GuildRecordUtils from "GuildRecordUtils" /* 1972 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
let closure_2 = ChannelRecord.createChannelRecordFromInvite;
const GuildFeatures = Constants.GuildFeatures;
const result = size.fileFinishedImporting("modules/guild_profile/GuildProfileUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getEstablishedDate = function getEstablishedDate(tmpResult4, locale) {
if (null != tmpResult4) {
if ("" !== tmpResult4) {
2026-07-20 16:05:17 +00:00
const _Date = Date;
const date = new Date(tmpResult4);
2026-07-20 16:05:17 +00:00
const _Date2 = Date;
let toLocaleDateStringResult = null;
if (date instanceof Date) {
const _isNaN = isNaN;
toLocaleDateStringResult = null;
if (!isNaN(date.getTime())) {
2026-07-23 10:11:24 +00:00
toLocaleDateStringResult = date.toLocaleDateString(locale, { year: "numeric", month: "short" });
2026-07-20 16:05:17 +00:00
}
}
return toLocaleDateStringResult;
}
}
return null;
};
export const guildInviteCanEmbedProfile = function guildInviteCanEmbedProfile(guild) {
if (null == guild.guild) {
return false;
} else {
const features = GuildRecordUtils.fromInviteGuild(guild.guild).features;
2026-07-20 16:05:17 +00:00
if (features.has(GuildFeatures.HUB)) {
return false;
} else {
let channel;
2026-07-29 08:29:29 +00:00
if (guild != null) {
2026-07-20 16:05:17 +00:00
channel = guild.channel;
}
let tmp2 = null;
if (null != channel) {
tmp2 = closure_2(guild.channel);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let isGuildVoiceOrThreadResult;
if (tmp2 != null) {
isGuildVoiceOrThreadResult = tmp2.isGuildVoiceOrThread();
}
return !isGuildVoiceOrThreadResult;
2026-07-20 16:05:17 +00:00
}
}
};