Return to Blog Home

Discord Upgrades

Source 

Discord Upgrades

D​iscord is great, but could do with a few slight unofficial upgrades...

Modifying existing software is far from new, and the emergence of many of the popular desktop applications being built on Electron greatly increases the ability to do so, Discord included.

Of course you should do this at your own risk, and don't just copy and paste random code you don't fully understand into any of your applications.

Enabling Developer Mode

There was a time where there was no steps needed to gain access to the developer tools, but now you need to enable developer mode in the settings.

One must first find your Discords settings.json file. This file should be located in the following directory based on your platform:

After locating, you'll want to add

"DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true

as a new key in the settings.json file. After this, you'll need to restart Discord for the changes to take effect.


If successful, you can now open the developer tools by pressing Ctrl + Shift + I on Windows and Linux, or Cmd + Shift + I on macOS.

Injectable Script Development

With all my injectable scripts I include a bit of boilerplate code to make it easier to develop them - essentially allowing them to uninstall themselves before the latest version was installed:

uninstallScriptName = (() => {
  if (typeof uninstallScriptName === 'function') uninstallScriptName();

  // ...

  return () => {
    // perform uninstallation steps
  }
})

Inbox Refresher

My first issue was that I wanted to be able to see new messages as soon as the appeared, and was not a fan of using notifications at the time, so would prefer to see them appear in the Discord inbox.

The issue is that it does not refresh - if you have it open and a new message comes in, it will not appear in the inbox until you close and open it.

So I wrote the Inbox Refresher script to do exactly as it says - if the inbox is opened and has no new messages, close it, wait, and open it again.

Then with the ability to jump straight to new messages via the inbox, I had less use for both the Guild navigation and sidebar, and while the Member list was hidable, these two were not.

So that's exactly what this script did, created two buttons - one for hiding and the other for showing - and added them to the page accordingly, toggling the display of the Guild navigation and sidebar accordingly.

Then I actually wanted further customization at points - to be able to put them on the right of the page for example, and I acheived this by setting the direction of their parents to rtl, and then all the children back to ltr in order to main text readability.

Fully-Resizable Window

The goal of the sidebar toggles was to give me more space for chat messages, but once I had that I realized I wasnted the window itself to be smaller, and after searching around found that there was actually a setting for it:

  "MIN_WIDTH": 0,
  "MIN_HEIGHT": 0,

Copy Tag

Next was making the mentioning of various entities easier - quite useful when trying to point a user to a thread, channel, or voice channel.

Manually this process involved copying the entity ID, then adding the appropriate prefix - but with a Copy Tag button, that part would be automated and all I would need to do was paste it in the chat.

Conclusion

Of course the disadvantage of these unofficial modifications is that they could break with any slight change to Discord, but I've been using them for a while now and they've been working fine - when they do break it's usually a slight change, no more then a few characters.