dashboard works

This commit is contained in:
NoLogicAlan committed 2026-05-08 00:51:17 +03:00
1 parent 7e0892bdca
commit f8e5275422
2 files changed
+100 -81

No files matched your search

+1 -40
View File
@@ -612,46 +612,7 @@ export class Remix {
if (!isMember) continue;
shared.push({
name: guild.name,
id: guildId,
icon: guild.icon
? `https://cdn.fluxer.app/icons/${guildId}/${guild.icon}.webp`
: null,
description: guild.description ?? null,
ownerId: guild.ownerId ?? null,
voiceChannels: guild.channels
.filter(c => c.isVoiceBased?.() ?? false)
.map(c => {
// Build voice participants list for this channel
const voiceParticipants = [];
if (guild.voice_states) {
const vs = Array.isArray(guild.voice_states) ? guild.voice_states :
typeof guild.voice_states.values === "function" ? [...guild.voice_states.values()] : Object.values(guild.voice_states);
for (const state of vs) {
const scId = String(state?.channelId ?? state?.channel_id ?? "").replace(/\D/g, "");
const chId = String(c.id ?? "").replace(/\D/g, "");
if (scId === chId) {
const member = guild.members?.get?.(state?.userId ?? state?.user_id);
if (member?.user && !member.user.bot) {
voiceParticipants.push(Dashboard.convertUser(member.user));
}
}
}
}
return {
name: c.name,
displayName: c.name,
id: c.id,
icon: null,
description: c.topic ?? null,
isVoice: true,
mature: c.nsfw ?? false,
serverId: guildId,
voiceParticipants,
};
}),
});
shared.push(Dashboard.convertServerForList(guild));
}
logger.dashboard(`[getSharedServers] Found ${shared.length} mutual servers for user ${userId}`);