---
title: "Bot configuration"
description: "Every setting of the DiscordMute bot and how to change it."
canonical_url: "https://docs.mute.yonn2222.com/configuration/bot-config"
---
# Bot configuration

> Every setting of the DiscordMute bot and how to change it.

The bot is set up in a file called `config.json` inside the `DiscordBot` folder. Rename `config.example.json` to `config.json` and fill in your values.

<warning>

In a text like a folder path, write every backslash twice (`C:\\Path`) or use forward slashes (`C:/Path`). A single backslash breaks the file.

</warning>

## Required settings

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        token
      </code>
    </td>
    
    <td>
      Your bot token from the <a href="https://discord.com/developers/applications" rel="nofollow">
        Discord Developer Portal
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        clientId
      </code>
    </td>
    
    <td>
      The application ID of your Discord bot.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        guildId
      </code>
    </td>
    
    <td>
      The ID of your Discord server.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        secret
      </code>
    </td>
    
    <td>
      A password shared between bot and plugin. It must be identical in both. Replace the example value <code>
        change-me
      </code>
      
      .
    </td>
  </tr>
</tbody>
</table>

## Optional settings

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        channelIds
      </code>
    </td>
    
    <td>
      <code>
        []
      </code>
    </td>
    
    <td>
      Backup voice channels. Used only when the bot cannot tell which channel the host is in.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        botIp
      </code>
    </td>
    
    <td>
      <code>
        0.0.0.0
      </code>
    </td>
    
    <td>
      Where the bot listens for the plugin. Use <code>
        localhost
      </code>
      
       if the plugin runs on the same PC.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        botPort
      </code>
    </td>
    
    <td>
      <code>
        7264
      </code>
    </td>
    
    <td>
      The port the bot listens on. It must match the plugin.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        disableTelemetry
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
    
    <td>
      Set to <code>
        true
      </code>
      
       to turn off <a href="https://docs.mute.yonn2222.com/privacy/telemetry">
        anonymous telemetry
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        disableUpdateCheck
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
    
    <td>
      Set to <code>
        true
      </code>
      
       to turn off the <a href="https://docs.mute.yonn2222.com/privacy/update-check">
        update check
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        logFormat
      </code>
    </td>
    
    <td>
      <code>
        pretty
      </code>
    </td>
    
    <td>
      <code>
        pretty
      </code>
      
       is the colored window. <code>
        json
      </code>
      
       is for <a href="https://docs.mute.yonn2222.com/monitoring/json-logs">
        log tools
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        metrics
      </code>
    </td>
    
    <td>
      off
    </td>
    
    <td>
      Settings for <a href="https://docs.mute.yonn2222.com/monitoring/metrics">
        metrics
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

## Example

```json
{
  "token": "YOUR_BOT_TOKEN",
  "clientId": "YOUR_CLIENT_ID",
  "guildId": "YOUR_GUILD_ID",
  "channelIds": [],
  "secret": "replace-this-with-your-own-secret",
  "botIp": "localhost",
  "botPort": 7264
}
```

To use the optional settings that are not in the example file, add them as extra lines:

```json
{
  "disableTelemetry": true,
  "disableUpdateCheck": true
}
```

## Running the hosted bot

<note>

This section is for operators of a hosted bot. Players use the [hosted setup](https://docs.mute.yonn2222.com/getting-started/hosted-setup) and need none of it.

</note>

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        mode
      </code>
    </td>
    
    <td>
      <code>
        self-host
      </code>
      
       (default) or <code>
        hosted
      </code>
      
      . In hosted mode <code>
        guildId
      </code>
      
       and <code>
        secret
      </code>
      
       are not used, every server gets its own secret from <code>
        /setup
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        adminApi
      </code>
    </td>
    
    <td>
      <code>
        { "host": "127.0.0.1", "port": 9465 }
      </code>
      
      . Where the admin API listens.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        databaseUrl
      </code>
    </td>
    
    <td>
      Required in hosted mode, together with <code>
        databaseDialect
      </code>
      
       set to <code>
        postgres
      </code>
      
       (see Advanced settings).
    </td>
  </tr>
</tbody>
</table>

Two environment variables are read besides `config.json`:

<table>
<thead>
  <tr>
    <th>
      Variable
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ADMIN_API_TOKEN
      </code>
    </td>
    
    <td>
      Required in hosted mode, at least 32 characters. Protects the admin API.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        HOSTED_TELEMETRY_TOKEN
      </code>
    </td>
    
    <td>
      Lets the hosted bot send telemetry to the website.
    </td>
  </tr>
</tbody>
</table>

## Advanced settings

You can ignore these on a normal setup.

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        databaseDialect
      </code>
    </td>
    
    <td>
      <code>
        sqlite
      </code>
    </td>
    
    <td>
      <code>
        sqlite
      </code>
      
       stores everything in a local file. <code>
        postgres
      </code>
      
       uses a database server.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        databaseUrl
      </code>
    </td>
    
    <td>
      none
    </td>
    
    <td>
      Address of the database server. Needed only for <code>
        postgres
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sqlitePath
      </code>
    </td>
    
    <td>
      <code>
        ./data/linking.sqlite
      </code>
    </td>
    
    <td>
      Where the local database file is saved.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        clusters
      </code>
    </td>
    
    <td>
      <code>
        { "total": 1, "shardsPerCluster": 1 }
      </code>
    </td>
    
    <td>
      Splits the bot over several processes. The default is right for one server.
    </td>
  </tr>
</tbody>
</table>


## Sitemap

See the full [sitemap](https://docs.mute.yonn2222.com/sitemap.md) for all pages.
