Build with Endcord

Everything you need to fix a bug, write a plugin, translate Endcord or design something for it, in one place.

Nothing here matches that. Try a simpler word, or ask on the Discord server.

Set up

You need Node.js 22 or newer, pnpm and Git, plus Discord on your computer.

  1. Get the codeFork the repository on GitHub, then clone your fork.
    git clone https://github.com/<your-username>/Endcord.git
    cd Endcord
    pnpm install
  2. Build while you workThis rebuilds Endcord every time you save a file.
    pnpm watch
  3. Put your build into DiscordRun this once. Afterwards, press Ctrl+R in Discord to load your latest build.
    pnpm inject
  4. Check your workThe same checks run on GitHub when you open a pull request.
    pnpm lint
    pnpm testTsc
    pnpm testSecurity

Test with a second Discord account or a test server where you can, not with your main account.

Your first plugin

A plugin is a folder in src/plugins with an index.ts that exports definePlugin().

  1. Make the folderCreate src/plugins/helloPanda/index.ts. The folder name is camelCase; the plugin's name is PascalCase.
  2. Write the pluginThis one adds a /panda command and a setting. Paste it in as it is; it builds.
    /*
     * Endcord, a Discord client mod
     * Copyright (c) 2026 rootpoi and contributors
     * SPDX-License-Identifier: GPL-3.0-or-later
     */
    
    import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands";
    import { definePluginSettings } from "@api/Settings";
    import { Devs } from "@utils/constants";
    import definePlugin, { OptionType } from "@utils/types";
    
    const settings = definePluginSettings({
        sleepy: {
            type: OptionType.BOOLEAN,
            description: "The panda answers half asleep",
            default: true
        }
    });
    
    export default definePlugin({
        name: "HelloPanda",
        description: "Adds /panda, and the panda says hello back",
        authors: [Devs.rootpoi], // add yourself to Devs in src/utils/constants.ts
        settings,
    
        commands: [{
            name: "panda",
            description: "Say hello to the panda",
            inputType: ApplicationCommandInputType.BUILT_IN,
            options: [{
                name: "name",
                description: "Who's saying hello",
                type: ApplicationCommandOptionType.STRING,
                required: false
            }],
            execute(args, ctx) {
                const name = findOption(args, "name", "friend");
                sendBotMessage(ctx.channel.id, {
                    content: settings.store.sleepy ? `zzz… oh, hi ${name} 🐼` : `Hi ${name}! 🐼`
                });
            }
        }]
    });
    • definePluginSettings makes the settings page for you and gives you typed values in settings.store.
    • ApplicationCommandInputType.BUILT_IN lists the command with Discord's own, so it works in servers and DMs.
    • sendBotMessage shows a reply only you can see. Nothing is sent to Discord.
  3. Turn it onRebuild, reload Discord, then open Endcord's settings and turn on HelloPanda. Type /panda in any chat.
  4. Change Discord itself with a patchWhen there's no API for what you need, a patch edits Discord's code as it loads. find picks the module and match and replace edit it; $self is your plugin.
    patches: [{
        // An illustration: real find strings come from reading Discord's code.
        // find is a piece of text that appears in exactly one of Discord's modules
        find: ".USER_PROFILE_MODAL",
        replacement: {
            // \i matches any minified name, so the patch survives Discord's rebuilds
            match: /(?<=user:(\i),)/,
            replace: "badge:$self.badgeFor($1),"
        }
    }],
    
    badgeFor(user) {
        return user.bot ? null : "🐼";
    }

    Keep find short and unique, and match the meaning of the code rather than exact minified names, so the patch keeps working when Discord updates.

API reference

The APIs plugins use most. Each link opens its source, where every exported function has a comment saying what it does. To use one, add its plugin to your dependencies, for example dependencies: ["UserSettingsAPI"].

Commands

Slash commands that show up in Discord's command menu, with options and replies only you see.

Settings

Typed plugin settings with defaults, shown in the plugin's settings page automatically.

ContextMenu

Add items to Discord's right-click menus for messages, users, channels and servers.

MessageEvents

Run code before a message is sent or edited, or when one is clicked.

MessageAccessories

Show your own content under a message.

MessageDecorations

Icons and tags next to the author's name in chat.

MessagePopover

Buttons in the toolbar that appears when you hover a message.

MessageUpdater

Change how a message already in the chat looks, without sending anything.

ChatButtons

Buttons next to the message box.

Badges

Badges on user profiles.

MemberListDecorators

Icons beside names in the member list.

NicknameIcons

Icons beside nicknames in profiles.

ProfileSections

Your own sections inside user profiles.

ServerList

Elements above or below the server list.

UserArea

Buttons in the user panel at the bottom left.

HeaderBar

Buttons in the bar at the top of a channel.

Notices

The notice bar across the top of Discord.

Notifications

Endcord's own pop-up notifications, with a log.

UserSettings

Read and change Discord's own settings, like your custom status.

DataStore

Save larger data on the user's computer, outside the settings file.

Styles

Add and remove CSS while a plugin runs.

Themes

Load and manage the user's themes.

Webpack

Find Discord's own modules, stores and components: findByProps, findStore, findComponentByCode and lazy versions of each.

The rest of the APIs, and the helpers in src/utils, are in the source. How the pieces fit together is in ARCHITECTURE.md.

Getting your change merged

Open a pull request against main with a short description of what changed and why, and a screenshot for anything you can see. A maintainer reviews it, usually asks for a change or two, and merges it once the checks pass.

Every change needs

  • Lint, the type check and the security tests passing
  • No growth in the bundle past the size limit
  • New user-facing text in all five languages. If you don't speak one, say so in the pull request
  • Settings that hold keys, tokens or addresses marked sensitive, so they never leave the computer
  • Your entry in Devs in src/utils/constants.ts if you wrote a plugin

We don't accept

  • Token loggers, self-bots, spam, raid or mass-delete tools
  • Fake mute or deafen, or anything that misleads people in voice
  • Sending tokens, messages or private data to services we haven't checked
  • Plugins that need a paid key to work at all
  • Large npm packages for small jobs

The full guidelines are in CONTRIBUTING.md, and how we treat each other is in the Code of Conduct.

Translations and docs

Endcord speaks English, Turkish, French, Spanish and Russian.

Every piece of text is written in English in the code and looked up in a file per language. To translate, add the English text as the key and your translation as the value:

// src/utils/i18n/locales/tr.ts
"Say hello to the panda": "Pandaya merhaba de",

// src/utils/i18n/pluginDescriptions/tr.ts
HelloPanda: "/panda komutunu ekler, panda da sana merhaba der.",

To fix a translation, change the value and open a pull request; you don't need to build anything. To add a new language, ask on the Discord server first so we can set up its files.

Documentation lives in docs/. The decision records there explain why things are the way they are, like signed updates and rollback. Fixes to them are as welcome as fixes to code.

Design resources

Every Endcord screen uses the same night-blue colours, whatever Discord theme the user has. Use the CSS variables, not fixed colours, so your plugin fits in.

Stuck?

Ask on the Discord server, or open an issue if something looks broken. Security problems go to the Trust Center instead.