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
| Setting | Meaning |
|---|---|
token | Your bot token from the Discord Developer Portal. |
clientId | The application ID of your Discord bot. |
guildId | The ID of your Discord server. |
secret | A password shared between bot and plugin. It must be identical in both. Replace the example value change-me. |
Optional settings
| Setting | Default | Meaning |
|---|---|---|
channelIds | [] | Backup voice channels. Used only when the bot cannot tell which channel the host is in. |
botIp | 0.0.0.0 | Where the bot listens for the plugin. Use localhost if the plugin runs on the same PC. |
botPort | 7264 | The port the bot listens on. It must match the plugin. |
disableTelemetry | false | Set to true to turn off anonymous telemetry. |
disableUpdateCheck | false | Set to true to turn off the update check. |
logFormat | pretty | pretty is the colored window. json is for log tools. |
metrics | off | Settings 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.
| Setting | Meaning |
|---|---|
mode | self-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. |
databaseUrl | Required in hosted mode, together with databaseDialect set to postgres (see Advanced settings). |
Two environment variables are read besides config.json:
| Variable | Meaning |
|---|---|
ADMIN_API_TOKEN | Required in hosted mode, at least 32 characters. Protects the admin API. |
HOSTED_TELEMETRY_TOKEN | Lets the hosted bot send telemetry to the website. |
Advanced settings
You can ignore these on a normal setup.
| Setting | Default | Meaning |
|---|---|---|
databaseDialect | sqlite | sqlite stores everything in a local file. postgres uses a database server. |
databaseUrl | none | Address of the database server. Needed only for postgres. |
sqlitePath | ./data/linking.sqlite | Where the local database file is saved. |
clusters | { "total": 1, "shardsPerCluster": 1 } | Splits the bot over several processes. The default is right for one server. |