feat(selfbot): dedicated DISCORD_STREAM_TOKEN for the broadcast account

Confirmed root cause of "broadcast doesn't appear in Discord" in userbot mode:
the conversation and the Go-Live broadcaster were the SAME Discord account on
two sessions. Discord allows one voice presence per account, so the broadcaster's
voice connection never connects (state voiceReady:false). Proven by isolating the
broadcaster: alone it connects ("Go-Live WebRTC connected"); alongside the
conversation it times out.

The broadcaster now logs in with DISCORD_STREAM_TOKEN when set (a second burner
account dedicated to streaming), falling back to DISCORD_SELFBOT_TOKEN (correct
for normal-bot mode). When userbot mode shares one account it warns loudly with
the fix. Documents the var in .env.example.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-06-13 15:30:33 +09:00
parent 5961faed38
commit 863337c6eb
3 changed files with 34 additions and 3 deletions

View File

@@ -46,6 +46,14 @@ export const config = {
// selfbot backend (ToS-risk; use a throwaway account token, never your main)
selfbotToken: opt("DISCORD_SELFBOT_TOKEN"),
// Account used for the Go-Live broadcast. In userbot mode the conversation and
// the broadcast CANNOT share one account: Discord allows a single voice
// presence per account, so the broadcaster's second session never connects
// (confirmed: alone it goes Live, alongside the conversation it times out).
// Set DISCORD_STREAM_TOKEN to a SECOND burner account dedicated to the
// broadcast. Empty = reuse DISCORD_SELFBOT_TOKEN (correct for normal-bot mode,
// where the conversation runs on the bot account, not the selfbot account).
streamToken: opt("DISCORD_STREAM_TOKEN"),
// How long to wait for the Go-Live stream WebRTC to actually reach
// "connected" before declaring the broadcast failed (and tearing the local
// ffmpeg pipeline down). Guards against reporting "live" when nothing reaches