This commit is contained in:
NoLogicAlan committed 2026-05-04 20:55:09 +03:00
1 parent a4991d7047
commit 687908ae0c
3 files changed
+51 -8

No files matched your search

+18 -1
View File
@@ -942,7 +942,7 @@ export class Remix {
logger.guild(`[GuildDelete] Cleanup complete for server ${guildId}.`);
});
client.on(Events.VoiceStateUpdate, (data) => {
client.on(Events.VoiceStateUpdate, async (data) => {
// data is the raw GatewayVoiceStateUpdateDispatchData — always snake_case
const userId = data?.user_id;
if (!userId) return;
@@ -1037,6 +1037,23 @@ export class Remix {
} catch (_) {}
}
// Notify dashboard of per-user voice-state change (join / leave / move)
if (this.dashboard?.enabled) {
try {
const userObj = data?.member?.user ?? await client.users.fetch(userId).catch(() => null);
if (userObj) {
const details = {
event: "voiceStateUpdate",
userId,
guildId: resolvedGuildId,
channelId: channelId ?? null,
oldChannelId: oldChannelId ?? null,
};
this.dashboard.updateUser(details, userObj);
}
} catch (_) {}
}
return;
}