debug(video): log raw GUILD_CREATE/READY/GUILD_MEMBERS_CHUNK shape

Temporary diagnostic to see whether GUILD_CREATE.voice_states actually
reaches the selfbot raw listener (selfbot-v13 emits everything via
WebSocketShard Events.RAW). Will remove once root cause confirmed.
This commit is contained in:
asepharyana
2026-09-02 02:10:22 +07:00
parent ac32179bb1
commit bc66babd45
@@ -101,7 +101,27 @@ export function setVideoRecorderClient(client: Client | undefined) {
t?: string;
d?: { voice_states?: unknown; id?: unknown };
} | null;
if (!p?.t || p.t !== "GUILD_CREATE") return;
if (!p?.t) return;
// DIAG: log every raw event type once until we see GUILD_CREATE shape.
if (
p.t === "GUILD_CREATE" ||
p.t === "READY" ||
p.t === "GUILD_MEMBERS_CHUNK"
) {
const d = p.d as Record<string, unknown>;
logger.info(
{
rawType: p.t,
hasVoiceStates: Array.isArray(d?.voice_states),
voiceStatesCount: Array.isArray(d?.voice_states)
? (d.voice_states as unknown[]).length
: -1,
dKeys: Object.keys(d ?? {}).slice(0, 10),
},
"RAW diag: GUILD_CREATE/READY/GUILD_MEMBERS_CHUNK",
);
}
if (p.t !== "GUILD_CREATE") return;
const vs = p.d?.voice_states;
handleGuildCreateVoiceStates(p.d as Record<string, unknown>, vs);
});