Caution
This library has reached end of life and is now considered deprecated and discontinued. It is recommended to convert over to using BetterDiscord's built-in API. If you find there are features missing, open a feature request in the BetterDiscord repository.
ZeresPluginLibrary - Download
This is the repo for Zere's Plugin Library for BetterDiscord. You can follow development here. There will be more info and shit to come, but for now here ya go.
View the library documentation here: https://zerebos.github.io/BDPluginLibrary/docs
The information below is just a quickstart guide and overview on using the build scripts provided.
If you'd like a real-world example, take a look at https://github.com/zerebos/BetterDiscordAddons
First add the library builder to your repo:
npm install zerespluginlibrary
Then add to your package.json
:
{
//...
"scripts": {
// ...
"build": "zpl build",
"init": "zpl init"
}
// ...
}
Create your ZPL config. You can use .zplrc
, .zplrc.js
, or a top-level zplConfig
key in package.json
;
// .zplrc.js
module.exports = {
base: "./examples",
out: "./release",
copyToBD: true,
addInstallScript: true
};
Initialize your first plugin with:
npm run init PluginName
You should a new folder with an index.js
and config.json
. When you're ready to build, just run:
npm run build PluginName
and a new PluginName.plugin.js
will be created in your output folder.
npm install
npm run build
This generates a BD compatible ./release/0PluginLibrary.plugin.js
file to be added to your plugins folder.
The library is configurable with the default configuration found in the package.json
.
Absolute or relative path to the folder where plugins that are built should be placed.
Default: "./release"
Absolute or relative path to the BetterDiscord folder. Useful when combined with copyToBD
. This folder is found automatically on most system.
Default: "<os-specific>/BetterDiscord"
Boolean to determine if the built plugin should also be automatically copied over to your BD plugins directory. Very convenient for development.
Default: false