- Rust 85.2%
- JavaScript 7.3%
- CSS 6%
- HTML 1.5%
| page | add configurable delay to display | |
| src | add ws domain variable | |
| .gitignore | initial discord bot and voice handler | |
| Cargo.lock | fix web | |
| Cargo.toml | fix web | |
| LICENSE | license and readme | |
| README.md | add ws domain variable | |
dvac (discord voice activity capture)
This is a discord voice activity capture bot that can display that information to a webpage that it hosts. This page can be used as an OBS browser source to display a discord voice call's activity on your stream.
how to
first, create a discord bot account and get the token (out of scope of this guide).
second, set environment variables. These ones are necessary for the bot to function:
DVAC_TOKEN: the discord bot's tokenDVAC_ROLE: the role that allows users to control the bot
These variables are not necessary, but allow you to further configure the bot:
DVAC_PREFIX: the prefix for the bot's commands. Default is ";"DVAC_WEBPAGE_ADDR: the address the bot should host the display webpage on. Default is localhost (127.0.0.1).DVAC_WEBPAGE_PORT: the port the bot should host the display webpage on. Default is 8080DVAC_WS_ADDR: the address the bot should host the websocket server (used for sending information to the webpage) on. Default is localhostDVAC_WS_PORT: the port the bot should host the websocket server on. Default is 8192DVAC_WS_DOMAIN: if you have the webpage for example behind a reverse proxy, the bot needs to know where this is so that it can call back for the websocket connection.
now you can run the bot (cargo run --release). it needs to be run in the same directory as the page subdirectory to work.
now, point your browser source at the address of the webpage (localhost:8080/index.html by default). nothing should display yet.
join a voice channel, ensure you have the role that you configured earlier, and run the capture command (default ;capture). the bot should join your
voice channel and mute itself. Once you start speaking / activate your push-to-talk, you should appear on the webpage.
use the 'stopcapture' command to disconnect the bot from the voice channel
it is safe to drag the bot between voice channels and to refresh the browser source.
to display the users horizontally, expanding from the center of the window instead of vertically expanding downwards from
the top left, point the browser source at index-horiz.html instead.
if you need to delay the display of circles, for example to synchronize with a video source, you can use the command ;setdelay x where x is
a number of seconds, with optional decimal places.
limitations
- users will not appear on the webpage until they speak at least once, or if they mute and unmute
- you cannot have two websocket clients (e.g. browser sources) active at the same time
- depending on how fast they load, there might be some weirdness as the profile pictures load in