decord/stable/source/modules/guild/markGuildsAsRead.tsx
github-actions 57c2214117 chore: update source for stable 347.12
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
2026-09-29 21:26:22 +00:00

89 lines
3.6 KiB
TypeScript

// Module ID: 14259
// Function ID: 14260
// Name: markGuildsAsRead
// Dependencies: [7377, 5755, 2041, 2096, 4803, 1074, 4970, 12, 11, 1241, 7387, 2]
// Exports: default
// Module 14259 (markGuildsAsRead)
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
import _modDef12 from "module_12" /* 12 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
import GuildOnboardingPromptsStore from "GuildOnboardingPromptsStore" /* 7377 */;
import ActiveJoinedThreadsStore from "ActiveJoinedThreadsStore" /* 5755 */;
import ChannelStore from "ChannelStore" /* 2041 */;
import GuildChannelStore from "GuildChannelStore" /* 2096 */;
import ReadStateStore from "ReadStateStore" /* 4803 */;
const require = fn;
const AnalyticEvents = fn(1074).AnalyticEvents;
const ReadStateTypes = fn(4970).ReadStateTypes;
const size = fn(2);
const result = size.fileFinishedImporting("modules/guild/markGuildsAsRead.tsx");
export default function markGuildsAsRead(arr, source, onFinished) {
const mapped = _modDef12.flatMap(arr, (guildId) => {
const selectableChannelIds = GuildChannelStore.getSelectableChannelIds(guildId);
const vocalChannelIds = GuildChannelStore.getVocalChannelIds(guildId);
const items = [...vocalChannelIds];
activeJoinedThreadsForGuild = activeJoinedThreadsForGuild.getActiveJoinedThreadsForGuild(guildId);
const iter = selectableChannelIds[Symbol.iterator]();
while (iter !== undefined) {
let obj = activeJoinedThreadsForGuild[iter.next()];
if (obj == null) {
obj = {};
}
for (const key10027 in obj) {
let arr = items.push(key10027);
continue;
}
continue;
}
return items;
}).map((channelId) => {
const obj = { channelId, readStateType: constants.CHANNEL, messageId: null };
channel = channel.getChannel(channelId);
let isForumLikeChannelResult;
if (channel != null) {
isForumLikeChannelResult = channel.isForumLikeChannel();
}
if (isForumLikeChannelResult) {
const _Date = Date;
let fromTimestampResult = SnowflakeUtilsDefault.fromTimestamp(Date.now());
} else {
fromTimestampResult = ReadStateStore.lastMessageId(channelId);
}
obj.messageId = fromTimestampResult;
return obj;
});
const item = arr.forEach((item) => {
const obj = { channelId: SnowflakeUtilsDefault.cast(item), readStateType: ReadStateTypes.GUILD_EVENT, messageId: ReadStateStore.lastMessageId(item, ReadStateTypes.GUILD_EVENT) };
mapped.push(obj);
const obj3 = { channelId: null, readStateType: null, messageId: null };
obj3.channelId = SnowflakeUtilsDefault.cast(item);
obj3.readStateType = ReadStateTypes.GUILD_ONBOARDING_QUESTION;
obj3.messageId = GuildOnboardingPromptsStore.ackIdForGuild(item);
mapped.push(obj3);
});
const flatMapResult = _modDef12.flatMap(arr, (guildId) => {
const selectableChannelIds = GuildChannelStore.getSelectableChannelIds(guildId);
const vocalChannelIds = GuildChannelStore.getVocalChannelIds(guildId);
const items = [...vocalChannelIds];
activeJoinedThreadsForGuild = activeJoinedThreadsForGuild.getActiveJoinedThreadsForGuild(guildId);
const iter = selectableChannelIds[Symbol.iterator]();
while (iter !== undefined) {
let obj = activeJoinedThreadsForGuild[iter.next()];
if (obj == null) {
obj = {};
}
for (const key10027 in obj) {
let arr = items.push(key10027);
continue;
}
continue;
}
return items;
});
AnalyticsUtilsDefault.track(AnalyticEvents.MARK_AS_READ, { source, type: "guild" });
let obj3 = { source, type: "guild" };
return mapped(7387).bulkAck(mapped, onFinished);
};