Skip to content
Samuel Elliott edited this page Mar 25, 2018 · 34 revisions

In order to use BDv2 yourself, you will for the time being have to build it yourself locally.

Development

Follow these instructions to set up a development environment for BDv2. If you just want to test it or write plugins/themes, follow the release section.

  1. Clone the repo/your fork.
  2. Run npm install and npm run build in the root of the repo.
  3. Build the node-sass binding or copy the prebuilt binding from other/node_sass_bindings. To build the binding for Electron 1.6 on your OS and move them to the correct location run npm run build_node-sass. Or run the command for your OS to copy the prebuilt bindings to the correct location:
    # macOS
    cp -R other/node_sass_bindings/darwin-x64-53 node_modules/node-sass/vendor/darwin-x64-53
    
    # Linux
    cp -R other/node_sass_bindings/linux-x64-53 node_modules/node-sass/vendor/linux-x64-53
    :: Windows
    copy "other\node_sass_bindings\win32-ia32-53" "node_modules\node-sass\vendor\win32-ia32-53"
  4. Download the emote data from https://github.com/JsSucks/BetterDiscordApp/releases/tag/emotedb and move it to tests/data.
    # macOS and Linux
    wget https://github.com/JsSucks/BetterDiscordApp/releases/download/emotedb/emotes.zip
    unzip emotes.zip
    mkdir -p tests/data
    mv emotes.json tests/data/emotes.json
    rm emotes.zip
  5. Edit discord_desktop_core/index.js to contain the following:
    new (require('path-to-bd-fork/core/dist/main.js').BetterDiscord)();
    module.exports = require('./core.asar');
    This file is located at %APPDATA%\Roaming\discord\0.0.300\modules\discord_desktop_core\index.js on Windows, ~/Library/Application Support/discord/0.0.250/modules/discord_desktop_core/index.js on macOS and ~/.config/discord/0.0.4/modules/discord_desktop_core/index.js on Linux.

To rebuild the core and the client and CSS editor bundles, run npm run build in the root of the repo.
To watch the core, run npm run watch_core in the root of the repo.
To watch the client, run npm run watch_client in the root of the repo.
To watch the CSS editor, run npm run watch_csseditor in the root of the repo.

Core rebuild requires full Discord restart. Client and CSS editor bundles can be reloaded with Ctrl + R (Windows and Linux) or Cmd + R (macOS).

Release

Follow these instructions if you want to test BDv2 exactly how it will run when released. Use this if you're developing plugins and/or themes.

  1. Clone the repo.
  2. Run npm install and npm run release in the root of the repo. This will delete the release directory, including any user data, rebuild it and copy the node-sass bindings.
  3. Download the emote data from https://github.com/JsSucks/BetterDiscordApp/releases/tag/emotedb and move it to release/data.
    # macOS and Linux
    wget https://github.com/JsSucks/BetterDiscordApp/releases/download/emotedb/emotes.zip
    unzip emotes.zip
    # Run this after building the release
    mkdir -p release/data
    cp emotes.json release/data/emotes.json
  4. Edit discord_desktop_core/index.js to contain the following:
    new (require('path-to-bd-fork/release').BetterDiscord)();
    module.exports = require('./core.asar');
    This file is located at %APPDATA%\Roaming\discord\0.0.300\modules\discord_desktop_core\index.js on Windows, ~/Library/Application Support/discord/0.0.250/modules/discord_desktop_core/index.js on macOS and ~/.config/discord/0.0.4/modules/discord_desktop_core/index.js on Linux.

To rebuild the release, follow steps 2 and 3 again.

Clone this wiki locally