# How to Set Up DiscordLink on Your Eco Server (/docs/eco/discord-link)



import { Step, Steps } from 'fumadocs-ui/components/steps';

**DiscordLink** is the de-facto Discord integration plugin for Eco — almost every public Eco server runs it. It bridges in-game chat to a Discord channel, sends election and government notifications, and lets your Discord users query server status with bot commands. Unlike most Discord integrations, it's a full server-side `.dll` plugin (not a webhook), which makes setup non-obvious.

This page covers installing it, registering a Discord bot, and the most useful configuration options.

What You Need First [#what-you-need-first]

* A **Discord server** you control (can create roles and bot users)
* An XGamingServer Eco instance you can stop, edit, and restart
* A **Discord bot token** — you'll create this in Step 1

Step 1: Create the Discord Bot [#step-1-create-the-discord-bot]

<Steps>
  <Step>
    Go to the [Discord Developer Portal](https://discord.com/developers/applications) and click **New Application**. Name it whatever you want (e.g. "EcoBot").
  </Step>

  <Step>
    In the left sidebar, click **Bot**. Click **Add Bot** if needed.
  </Step>

  <Step>
    Under **Token**, click **Copy** (or **Reset Token** then **Copy**). Save this string — it's your `BotToken` for the plugin config. **Never share or commit it.**
  </Step>

  <Step>
    Scroll down to **Privileged Gateway Intents** and enable:

    * **Server Members Intent**
    * **Message Content Intent**

    Save changes.
  </Step>

  <Step>
    Click **OAuth2 → URL Generator**. Check **bot** under Scopes. Under Bot Permissions, check **Send Messages**, **Read Message History**, **Manage Messages**, **Embed Links**, **Mention Everyone**.
  </Step>

  <Step>
    Copy the generated URL at the bottom, paste it in your browser, and authorize the bot to join your Discord server.
  </Step>
</Steps>

Step 2: Install the DiscordLink Plugin [#step-2-install-the-discordlink-plugin]

<Steps>
  <Step>
    Stop your Eco server from **Console** in the [XGamingServer Panel](https://panel.xgamingserver.com).
  </Step>

  <Step>
    Download the latest DiscordLink release from [github.com/Eco-DiscordLink/EcoDiscordPlugin/releases](https://github.com/Eco-DiscordLink/EcoDiscordPlugin/releases). Match the release version to your Eco server version.
  </Step>

  <Step>
    Extract the zip locally. You'll get a `DiscordLink/` folder containing `.dll` files and a default config.
  </Step>

  <Step>
    In **Files**, navigate to:

    ```
    Eco/Eco_Data/Server/Mods/
    ```

    Upload the extracted `DiscordLink/` folder here.
  </Step>

  <Step>
    Start the server once. DiscordLink generates its config files in:

    ```
    Eco/Eco_Data/Server/Configs/Mods/DiscordLink/
    ```

    Stop the server again so you can edit them.
  </Step>
</Steps>

Step 3: Configure DiscordLink [#step-3-configure-discordlink]

Open the config file generated in `Configs/Mods/DiscordLink/`. The key fields:

```json
{
  "BotToken": "PASTE_YOUR_BOT_TOKEN_HERE",
  "EcoBotName": "Eco Bot",
  "DiscordCommandPrefix": "?",
  "AdminRoles": ["Admin", "Moderator"],
  "ServerName": "My Eco Server",
  "ChatChannelLinks": [
    {
      "DiscordChannel": "general",
      "EcoChannel": "General",
      "Direction": "Duplex"
    }
  ]
}
```

| Key                    | What                                                                                      |
| ---------------------- | ----------------------------------------------------------------------------------------- |
| `BotToken`             | The Discord bot token from Step 1. **Required.**                                          |
| `EcoBotName`           | Display name the bot uses in Eco chat                                                     |
| `DiscordCommandPrefix` | Prefix for Discord-side commands (e.g. `?ecostatus`)                                      |
| `AdminRoles`           | Discord role names that can run admin commands                                            |
| `ServerName`           | Display name in bot status messages                                                       |
| `ChatChannelLinks`     | One entry per linked channel — direction: `Duplex`, `Discord-to-Eco`, or `Eco-to-Discord` |

Save the config and start the server. Watch the console for `DiscordLink: Connected to Discord` confirming the bot logged in.

Step 4: Verify the Link [#step-4-verify-the-link]

In Eco [#in-eco]

Connect to your server in-game and type:

```
/verifydiscord
```

The bot DMs you a verification code which you paste into Discord to link your accounts.

In Discord [#in-discord]

In a channel the bot can see, type:

```
?ecostatus
```

The bot responds with current server status (uptime, player count, world progress).

```
?players
```

Lists currently connected players.

Useful Configuration Recipes [#useful-configuration-recipes]

Bridge in-game chat both ways [#bridge-in-game-chat-both-ways]

```json
"ChatChannelLinks": [
  {
    "DiscordChannel": "general",
    "EcoChannel": "General",
    "Direction": "Duplex"
  }
]
```

Mirror only in-game to Discord (not the reverse) [#mirror-only-in-game-to-discord-not-the-reverse]

```json
"Direction": "Eco-to-Discord"
```

Multiple channels for different in-game chats [#multiple-channels-for-different-in-game-chats]

```json
"ChatChannelLinks": [
  { "DiscordChannel": "general", "EcoChannel": "General", "Direction": "Duplex" },
  { "DiscordChannel": "trade", "EcoChannel": "Trades", "Direction": "Duplex" },
  { "DiscordChannel": "law", "EcoChannel": "Law", "Direction": "Eco-to-Discord" }
]
```

Common Issues [#common-issues]

| Problem                               | Cause                                              | Fix                                                                       |
| ------------------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------- |
| Bot doesn't connect                   | Wrong `BotToken` or token was reset                | Generate a new token, paste into config                                   |
| Bot connects but doesn't see messages | Message Content Intent disabled                    | Re-enable in Discord Developer Portal                                     |
| Eco messages not appearing in Discord | Channel name mismatch or `Direction` set wrong     | Confirm `DiscordChannel` matches the actual channel name (case-sensitive) |
| `?ecostatus` returns nothing          | Bot lacks Send Messages permission in that channel | Re-invite via OAuth2 URL with correct permissions                         |
| Plugin doesn't load on server start   | Eco version mismatch with the DiscordLink release  | Download the matching version from GitHub releases                        |

Related Guides [#related-guides]

* [Install Mods](/docs/eco/install-mods)
* [Configure Your Server](/docs/eco/configure-your-server)
* [Adding Admins](/docs/eco/adding-admins)
