Merge branch 'gitlab-ci' into 'master'
Move from Travis to Gitlab CI See merge request !4
|1 year ago|
|24h-stamps.deprecated||2 years ago|
|common||2 years ago|
|core||1 year ago|
|dcss||1 year ago|
|dmodsapi||1 year ago|
|installer||1 year ago|
|signer||2 years ago|
|vendor||1 year ago|
|.gitignore||2 years ago|
|.gitlab-ci.yml||1 year ago|
|LICENSE||2 years ago|
|README.md||1 year ago|
|build_all.sh||1 year ago|
|test.sh||1 year ago|
Discord.Mods is an unofficial modloader for Discord with a focus on reducing the modding surface in the client and offloading as much as possible into external code.
Currently, Discord.Mods uses the node.js ASAR utility to install by default, however, a node.js free binary is available that should be stable and functional.
To install, simply compile the binary with Go of atleast version 1.8 or download the latest release binary from the Releases Page
Running the binary is simple;
The installer will attempt to autodetect most configurations and install itself.
By default it uses the external ASAR engine, for this to work you need to have node.js with
asar binary in your path. If you do not, the installation will fail safely.
To use the internal engine use
To install the asar binary, simply type;
npm -g install asar
If the core.js or other files included in the installer have updated, simply run;
The installer uses multiple flags to ensure you won’t accidentally kill your install.
--restore flag instructs the installer to copy it’s backup of the original Discord
back to the original location and install again
--overwrite flag instructs the isntaller to ignore any pre-existing installs. This option should only be used along with
--reinstall and is not recommended unless you lost the original file
If you changed the app.asar file in your Discord install, it’s recommended to use
--reinstall instructs the installer to remove pre-existing bootstrap.js instances and reinsert them. This function is most likely less reliable than a simple
--reinstall flag as it requires the
The installer is designed to operate as safely as possible.
It will not install to your installation if it detects a backup file in it’s folder, assuming that this means that the bootstrap.js file is already installed.
If you already installed the bootstrap.js file, you can use
--only-mods to update
the core libraries.
Discord.Mods uses the bootstrap.js file which looks for the file
%USER%/.discord.mods/core.js on Windows, reads the contents and evals it.
core.js is a GopherJS application which then executes all further code. It also sets
up a namespace for public API functions;
Mods are loaded from
.dmod file represents a mod which must
be accompanied by a folder named like the file without extension.
24h-stamps.dmod must put it’s contents into
.dmod file is a simple yaml file that contains various information about the mod
including update urls and versioning.
Due to the simplicity of the
core.js file, mods cannot have a dependency order.
Instead, when all mods are setup, the
core.js file will execute a special
callback handler which notifies all other mods.
To register for this callback, call
The only parameter is the function you wish to execute.
Ordering and Dependency Resolution is a task of a higher level mod.
Discord.Mods comes with a simple notification API for changes in the browser window plus an event handler.
To register for an event call
dmodsNS.onEvent(id, event, callback).
The ID must be unique to the mod, conflicting IDs will overwrite eachothers callbacks.
To dispatch an event, call