dashboard tests

This commit is contained in:
NoLogicAlan committed 2026-05-07 23:42:19 +03:00
1 parent 9366bbe95a
commit 37c29ca6cd
3 files changed
+44 -30

No files matched your search

+31 -1
View File
@@ -577,9 +577,39 @@ export class Remix {
icon: guild.icon
? `https://cdn.fluxer.app/icons/${guild.id}/${guild.icon}.webp`
: null,
description: guild.description ?? null,
ownerId: guild.ownerId ?? null,
voiceChannels: guild.channels
.filter(c => c.isVoiceBased?.() ?? false)
.map(c => ({ name: c.name, id: c.id, icon: null })),
.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: guild.id,
voiceParticipants,
};
}),
});
}