2 Commits
Author SHA1 Message Date
asepharyana f1da40691f docs(gateway): mark DAVE stream-watch P1-P3 done, P4 blocked on live streamer 2026-08-31 14:09:06 +07:00
asepharyana 374fd5a9c2 fix(gateway): use guild voice sessionId for watch RTC identify
The previous code read the sessionId from the selfbot client's voice manager
(client.voice.connection), which is no longer established since ensureSelfbotVoice
was removed — it would have sent sessionId:'none' in the watch Networking
identify and been rejected. Read the active session from the guild
@discordjs/voice connection (getVoiceConnection(guildId).state.networking...
connectionOptions.sessionId) instead.
2026-08-31 14:03:00 +07:00
2 changed files with 27 additions and 10 deletions

No files matched your search

@@ -1,6 +1,6 @@
# Spec: Receive Others' Screen-Share/Camera Video Under DAVE — Build a DAVE-capable Stream-Watch Connection
Status: PLANNED (~multi-session)
Status: **P1–P3 DONE (implemented + deployed); P4 (live verify) BLOCKED on a real streamer**
Date: 2026-08-31
Author: Hermes
Related: `.hermes/plans/2026-08-31_video-receive-eager-selfbot-connection-spec.md` (superseded by this)
@@ -30,7 +30,11 @@ import {
type WriteStream,
} from "node:fs";
import path from "node:path";
import { Networking, type NetworkingState } from "@discordjs/voice";
import {
getVoiceConnection,
Networking,
type NetworkingState,
} from "@discordjs/voice";
import type Davey from "@snazzah/davey";
import { MediaType } from "@snazzah/davey";
import type { Client, VoiceChannel } from "discord.js-selfbot-v13";
@@ -193,14 +197,27 @@ function connectWatch(
const botId = _client?.user?.id;
if (!botId) return;
// The bot's ACTIVE voice-session id (from the selfbot client's voice manager —
// the same session the guild @discordjs/voice connection rides).
const voiceManager = (
_client as unknown as {
voice?: { connection?: { authentication?: { sessionId?: string } } };
}
).voice;
const sessionId = voiceManager?.connection?.authentication?.sessionId;
// The bot's ACTIVE voice-session id, from the guild @discordjs/voice
// connection (the watch RTC identify must carry the SAME session the bot is
// joined in with). The gateway's audio connection is the voice session; the
// selfbot client's voice manager is NOT established anymore.
const guildConn = getVoiceConnection(guildId);
const sessionId =
(
guildConn as unknown as {
state?: {
networking?: {
state?: { connectionOptions?: { sessionId?: string } };
};
connectionOptions?: { sessionId?: string };
};
}
)?.state?.networking?.state?.connectionOptions?.sessionId ??
(
guildConn as unknown as {
state?: { connectionOptions?: { sessionId?: string } };
}
)?.state?.connectionOptions?.sessionId;
logger.info(
{ userId: uid, endpoint, serverId, hasSession: !!sessionId },