Coder Social home page Coder Social logo

discord-ambience-bot's Introduction

Stream your local music directly into your RPG Session on Discord

There are several solutions streaming your local audio directly into Discord, many invovle PulseAudio or Voicemeeter (Banana/ Potato). The audio quality for me was never sufficient.

By registering a bot on the Discord Site, then running this bot locally and inviting it to your own Discord server, you have a much higher quality of your current audio stream with minimal config

Configuration

Setting up Discord

  1. Go to the Discord Developer Portal and register a new application.
  2. On the General Information-Tab: Provide a App Icon and a Name
  3. On the OAuth2-Tab: Check the bot scope, then copy the generated oAuth link into your clipboard
  4. On the same tab, check the following permissions: Voice Permissions/Connect and Voice Permissions/speak
  5. On the Bot-Tab: Upload an App Icon and copy the bot token, insert that into the `.env´ file locally
  6. Go to the copied oauth2 URL and invite the bot to the desired server.

Setting up the local environment

This bot has been testet on Windows 10 and it is working. Since we are using low-level system access, we do need to compile several libraries locally. node-gyp will do the heavy lifting for us, but we need to install some prerequisites by hand.

Linux

sudo apt-get install build-essentials

Windows

  1. Open a powershell command line with elevated (= admin) rights.
  2. Run npm install --global windows-build-tools

The installation is taken quite long and you might be getting stuck in either the Windows build tools installer or in the python installer. Unfortunately, this setup is rather fragile and I can only recommend to

  • reboot the server, then do the installation since it is sensible if any outstanding tasks from the installer service are not yet finished
  • remove any manually installed python versions if the installer fails

Get your Audio Device

Run node listAudioHardware to get the ID of your desired audo device and insert that into the variable audioDeviceId in index.js.

Permissions

Change roleNames to any Role Name that should be able to use the bot. Note: they still must have the index.js on their computer and need to run through the requirements above to prepare a work environment for the locally run bot.

Usage

  1. Connect to your Discord server
  2. Go into a voice Channel
  3. /ambience summons the bot into your channel, it starts playing audio right away
  4. /ambience again will disconnect the bot from the current audio channel

discord-ambience-bot's People

Contributors

shwill avatar vttassets avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.