README.md

Theatre Bot

A Discord self-bot that streams browser content to voice channels, controllable via a remote web UI.

Very early alpha. Latency is high and the UI is not very user-friendly.

Caution

Using any kind of automation programs on your account can result in your account getting permanently banned by Discord. Use at your own risk

Features

  • 📺 Live Browser Streaming - Stream browser content to Discord voice channels
  • 🎮 Remote Control - TV-remote style web UI for navigation
  • 🔗 Smart Presets - Quick access to YouTube and Plex with context-aware search
  • 🔐 RBAC - Discord role-based access control

Setup

Prerequisites

  • Node.js 22.4.0 or newer (required by discord-video-stream v7)
  • Linux with X11/Xvfb and PulseAudio for browser screen/audio capture
  • Chrome/Chromium and a matching ChromeDriver
  • FFmpeg with x11grab, pulse, libx264, libopus, and the azmq filter (libzmq enabled); stable H265/VP8 also need libx265/libvpx
  • Docker/Podman for the bundled Linux deployment

Installation

bash
1# Install locked dependencies, including native install scripts
2npm ci
3
4# Copy environment config
5cp .env.example .env
6
7# Edit .env with your Discord token

The v7 streaming library uses the @lng2004/discord.js-selfbot-v13 client and native WebRTC/DAVE and FFmpeg dependencies. Allow dependency install scripts, including node-av, @lng2004/node-datachannel, and zeromq, in package managers that require approval. Installation needs access to native binary downloads; if a prebuilt binary is unavailable for your platform, follow that package's source-build prerequisites. Do not use --ignore-scripts.

The container downloads the BtbN FFmpeg build with libzmq. If using your own FFmpeg, check ffmpeg -filters for azmq. Set FFMPEG_PATH to override the executable used for both capture and stable transcoding.

Discord Token

You need a Discord user token (not a bot token). See the StreamBot wiki for instructions.

⚠️ Warning: Self-bots violate Discord ToS. Use a dedicated account.

Running

bash
1# Compile TypeScript and run
2npm run build
3npm start
4
5# Verify the migration contracts and stop/restart lifecycle
6npm test

Usage

  1. Configure your Discord token in .env
  2. Start the bot with npm run start
  3. Use Discord commands to join a voice channel
  4. Control the browser via the web UI at http://localhost:8080

Discord Commands

CommandBehavior
!joinDefault capture: one H264 encode plus real browser audio encoded as Opus in NUT; v7 handles demuxing, WebRTC packetization, and DAVE.
!betaAlias for !join, retained for existing commands.
!stableOlder capture path: MPEG-2/PCM Matroska, then v7 transcodes to the configured video codec and Opus in NUT.
!leaveStop capture/playback and leave the voice channel.
!url <url> / !goto <url>Navigate the streaming browser.
!helpShow command help.

Both modes use v7 Go Live playback with stream previews disabled. The default !join mode (and its !beta alias) always uses H264; the configured dimensions, frame rate, bitrates, and H26x preset still apply. Use !stable for the older transcoding path, including configured H265/VP8 output. Use !leave before switching modes. The bot automatically leaves an empty channel.

RBAC Permissions

LevelCapabilities
joinRequest bot to join your call, control sessions you started
controlUse remote navigation + presets on any session you're connected to
navigateUpdate the URL to any page instead of presets
adminConfigure permissions via slash commands

Server owners and administrators automatically have admin permissions.

Container Deployment

⚠️ Note: Browser capture requires Linux with X11/Xvfb and PulseAudio. Use the container on macOS/Windows. Native dependency installation and live Discord streaming must be verified on the target platform.

With Podman/Docker Compose

bash
1# Copy and configure environment
2cp .env.example .env
3# Edit .env with your Discord token
4
5# Build and run
6podman-compose up -d
7# or
8docker compose up -d

Manual Container Build

bash
1# Build
2podman build -t theatre-bot .
3
4# Run
5podman run -d \
6 --name theatre-bot \
7 --env-file .env \
8 --shm-size=2gb \
9 -p 8080:8080 \
10 theatre-bot

License

MIT