Greasy Fork is available in English.

Discord: Enable Dark Mode

Enables dark mode on Discord.

// ==UserScript==
// @name         Discord: Enable Dark Mode
// @description  Enables dark mode on Discord.
// @version      1.0
// @author       Bard
// @namespace    https://bard.ai
// @match        *://*/*
// @run-at       document-start
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
  "use strict";

  // Get the Discord client.
  var Discord = require("discord.js");

  // Create a new Discord client.
  var client = new Discord.Client();

  // When the client is ready, enable dark mode.
  client.on("ready", async () => {
    // Get the current theme.
    var theme = await client.user.settings.get("theme");

    // If the current theme is light, change it to dark.
    if (theme === "light") {
      await client.user.settings.set("theme", "dark");
    }
  });

})();