Client Configuration
Citadel Bot reads two bot-wide config sources: config/config.js (settings)
and config/.env (secrets and runtime flags). Per-server settings live
separately in config/servers.js.
config/config.js
Copy config.example.js to config.js and edit:
const { PermissionsBitField } = require('discord.js');
module.exports = {
// Bot presence
presence: {
status: 'online', // online | idle | dnd | invisible
activities: [ { name: '/help', type: 'Listening' } ] // Playing | Streaming | Listening | Watching
},
// Who has elevated permission levels (see Permissions)
permissions: {
moderatorRoleIds: [ 'roleId', ... ], // → Moderator (level 1)
administratorRoleIds: [ 'roleId', ... ], // → Administrator (level 2)
ownerId: 'yourDiscordUserId', // → Bot Owner (level 5)
developers: [ 'userId', ... ] // → Developer (level 4)
},
// Permissions added when generating the /invite link
permissionsBase: [
PermissionsBitField.Flags.ViewChannel,
PermissionsBitField.Flags.SendMessages,
PermissionsBitField.Flags.SendMessagesInThreads
],
// Where /support points
supportServerInviteLink: 'https://discord.gg/UnJajmfuKs'
};
See Permissions for how the role/ID lists map to permission levels.
Environment variables
Required
| Variable | What |
|---|---|
DISCORD_BOT_TOKEN | The bot token |
CLIENT_ID | The application (client) id |
CFTOOLS_API_APPLICATION_ID | CFTools application id (hex) |
CFTOOLS_API_SECRET | CFTools application secret |
Slash command registration
| Variable | Default | What |
|---|---|---|
REFRESH_SLASH_COMMAND_API_DATA | true | Register/refresh commands on boot |
CLEAR_SLASH_COMMAND_API_DATA | false | Clear all command data on boot |
TEST_SERVER_GUILD_ID | — | If set, register commands instantly in this one guild (otherwise global, up to ~1h to propagate) |
Operational
| Variable | Default | What |
|---|---|---|
NODE_ENV | production | Set production for deployment |
USE_API | false | Enable the optional HTTP API |
PORT | 3000 | Port for the HTTP API |
Debug
| Variable | Default | What |
|---|---|---|
DEBUG_ENABLED | false | Verbose debug logging |
DEBUG_INTERACTIONS | false | Dump each interaction object to the console |
DEBUG_SLASH_COMMAND_API_DATA | true | Log command data on refresh |
DEBUG_AUTOCOMPLETE_RESPONSE_TIME | true | Log autocomplete timings |
DEBUG_COMMAND_THROTTLING | false | Log cooldown throttling |
Coolify / env-only deploys
When generating config from the environment (see Installation → Coolify), these additional vars feed the generator:
| Variable | Maps to |
|---|---|
OWNER_ID | permissions.ownerId |
MODERATOR_ROLE_IDS / ADMINISTRATOR_ROLE_IDS | comma-separated role lists |
DEVELOPER_IDS | permissions.developers |
SUPPORT_SERVER_INVITE | supportServerInviteLink |
SERVER_NAME, CFTOOLS_SERVER_API_ID, SERVER_IPV4, SERVER_PORT | the generated server entry |
CITADEL_RELAY_ENABLED, CITADEL_API_URL, CITADEL_SERVICE_ID, CITADEL_API_KEY | relay settings |
Next: Server Configuration.