- Custom clients are prohibited by the Discord ToS. Use at your own risk.
- While using DiscordInjector, do not contact Discord for any kind of support regarding the client. Each non-official line running in the app is yet another factor to take into consideration in case something goes wrong, and the Discord dev team should not need to take it into account.
- Also, don't write any kind of spamming tool using DiscordInjector. This projects aims to enhance your Discord experience, not harm other's.
DiscordInjector is a patch for the desktop Discord client which lets you inject any node code (extensions) in the application. You can do anything with it from modifying the CSS to hooking the message send action to modify your messages, opening a new window (practically creating a new application inside Discord), or read/write local files.
Once DiscordInjector is installed, an icon of a syringe will appear at the top right corner of the window. Click it, and you'll se a list of loaded extensions. The extensions are .js
files stored at APPDATA/discord-injector
, where APPDATA
is %APPDATA%
on Windows and XDG_CONFIG_HOME
or ~/.config
on GNU/Linux.
The environment variable DISCORD_DIR
can be set to discordptb
to patch the public test build.
I guess it's fun? Extending the capabilities of an application is always nice.
A python script is offered to automatically patch your Discord installation and makes it easy to update. Run it with python3 patch.py
.
- Close Discord.
- Go to
APPDATA/discord/VERSION/modules/discord_desktop_core
, whereAPPDATA
is the same as explained above, andVERSION
is currently0.0.10
, but may change in the future. - Make a backup of
core.asar
. - Unpack the ASAR file:
asar extract core.asar extracted
. You might need to installasar
withnpm install -g asar
. - Go to
extracted/app
. - Append the contents of
DiscordInjector.js
at the end of the filemainScreenPreload.js
. - Repack the ASAR file:
asar pack extracted core.asar
.
You have the functions DiscordInjector_getExtensionsDir
(which returns the extensions directory) and DiscordInjector_getExtensions
(gives an array of the names, including .js
) at your disposal in case you want to check if another extension is present (for dependency checking).
They are loaded asynchronously, so you cannot rely on another one being loaded before yours.
The SVG of the syringe comes from here, resized with this tool and compressed with this other one.