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 theazmqfilter (libzmqenabled); stable H265/VP8 also needlibx265/libvpx - Docker/Podman for the bundled Linux deployment
Installation
| 1 | # Install locked dependencies, including native install scripts |
| 2 | npm ci |
| 3 | |
| 4 | # Copy environment config |
| 5 | cp .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
| 1 | # Compile TypeScript and run |
| 2 | npm run build |
| 3 | npm start |
| 4 | |
| 5 | # Verify the migration contracts and stop/restart lifecycle |
| 6 | npm test |
Usage
- Configure your Discord token in
.env - Start the bot with
npm run start - Use Discord commands to join a voice channel
- Control the browser via the web UI at
http://localhost:8080
Discord Commands
| Command | Behavior |
|---|---|
!join | Default capture: one H264 encode plus real browser audio encoded as Opus in NUT; v7 handles demuxing, WebRTC packetization, and DAVE. |
!beta | Alias for !join, retained for existing commands. |
!stable | Older capture path: MPEG-2/PCM Matroska, then v7 transcodes to the configured video codec and Opus in NUT. |
!leave | Stop capture/playback and leave the voice channel. |
!url <url> / !goto <url> | Navigate the streaming browser. |
!help | Show 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
| Level | Capabilities |
|---|---|
join | Request bot to join your call, control sessions you started |
control | Use remote navigation + presets on any session you're connected to |
navigate | Update the URL to any page instead of presets |
admin | Configure 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
| 1 | # Copy and configure environment |
| 2 | cp .env.example .env |
| 3 | # Edit .env with your Discord token |
| 4 | |
| 5 | # Build and run |
| 6 | podman-compose up -d |
| 7 | # or |
| 8 | docker compose up -d |
Manual Container Build
| 1 | # Build |
| 2 | podman build -t theatre-bot . |
| 3 | |
| 4 | # Run |
| 5 | podman run -d \ |
| 6 | --name theatre-bot \ |
| 7 | --env-file .env \ |
| 8 | --shm-size=2gb \ |
| 9 | -p 8080:8080 \ |
| 10 | theatre-bot |
License
MIT