Configuration

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.

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.

Required settings

SettingMeaning
tokenYour bot token from the Discord Developer Portal.
clientIdThe application ID of your Discord bot.
guildIdThe ID of your Discord server.
secretA password shared between bot and plugin. It must be identical in both. Replace the example value change-me.

Optional settings

SettingDefaultMeaning
channelIds[]Backup voice channels. Used only when the bot cannot tell which channel the host is in.
botIp0.0.0.0Where the bot listens for the plugin. Use localhost if the plugin runs on the same PC.
botPort7264The port the bot listens on. It must match the plugin.
disableTelemetryfalseSet to true to turn off anonymous telemetry.
disableUpdateCheckfalseSet to true to turn off the update check.
logFormatprettypretty is the colored window. json is for log tools.
metricsoffSettings for metrics.

Example

{
  "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:

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

Running the hosted bot

This section is for operators of a hosted bot. Players use the hosted setup and need none of it.
SettingMeaning
modeself-host (default) or hosted. In hosted mode guildId and secret are not used, every server gets its own secret from /setup.
adminApi{ "host": "127.0.0.1", "port": 9465 }. Where the admin API listens.
databaseUrlRequired in hosted mode, together with databaseDialect set to postgres (see Advanced settings).

Two environment variables are read besides config.json:

VariableMeaning
ADMIN_API_TOKENRequired in hosted mode, at least 32 characters. Protects the admin API.
HOSTED_TELEMETRY_TOKENLets the hosted bot send telemetry to the website.

Advanced settings

You can ignore these on a normal setup.

SettingDefaultMeaning
databaseDialectsqlitesqlite stores everything in a local file. postgres uses a database server.
databaseUrlnoneAddress of the database server. Needed only for postgres.
sqlitePath./data/linking.sqliteWhere the local database file is saved.
clusters{ "total": 1, "shardsPerCluster": 1 }Splits the bot over several processes. The default is right for one server.