Skip to main content
Freesona has two configuration layers. The .env file handles startup configuration — credentials, provider selection, file paths, and optional integration keys. This file is read once when the bot launches and requires a restart to change. The runtime config layer handles tunable behavior values — polling intervals, timeouts, generation pacing — via /config commands that take effect immediately without a restart.

Environment Variables

Copy .env.sample to .env and fill in your values before launching the bot:

Required

These three variables must be set. The bot refuses to start if any of them is missing or still holds a placeholder value.

AI Provider Keys

You only need to set the key for the provider you selected in AI_PROVIDER. Leave the others blank. You can also set MODEL_NAME to override the default model for your chosen provider, or use AI_PROVIDER_MODEL to set a per-provider model override that persists across provider switches.

Optional Integrations

These variables unlock specific features. The bot starts and runs normally without them — the corresponding commands will simply be unavailable or fall back to a different method.

File Paths

Freesona stores several mutable files: a runtime config file, a user memory database, a warnings database, a character memory database, an anniversaries database, a canon database, and persona files. The correct paths depend on where you are hosting the bot.
On cloud hosts without a persistent volume, file changes do not survive a redeployment. The container resets to the image state. Mount a persistent volume at /data and switch to the /data/ paths in your .env to keep your config, memory, warnings, and persona across deploys.

Logging

Freesona uses a structured logging system. These variables control logging behavior:

Runtime Config

The /config command group lets the bot owner inspect and adjust tunable behavior values while the bot is running. Changes take effect immediately. No restart is needed. These commands require you to be the bot owner (the account that owns the Discord application in the Developer Portal).

Commands

  • /config list — Prints all configurable keys with their descriptions and current defaults.
  • /config show [key] — Shows the current value and default for one key, or all keys if you omit the argument.
  • /config set <key> <value> — Updates a key to a new value immediately. The bot converts the value to the correct type (int, float, bool, or string) based on the key’s default type.
  • /config reset <key> — Removes the override and restores the key to its compiled-in default.

Configurable Keys

These are the configurable keys and the defaults the bot ships with.

Example Usage

Use /dumpconfig to see the full contents of your current config.json in one shot. Useful for verifying the state of all settings at once.

config.json

config.json is the bot’s runtime state file. Freesona reads it on startup and writes to it whenever you use commands that change persistent settings. You do not need to edit this file manually. The Discord commands are the intended interface. A fresh config.json starts from config.sample.json and contains only:
config.json
As you use the bot, it accumulates additional fields:
You do not edit config.json directly. Use the Discord commands — ~prefix, /setchannel, /autonomy, /module, /provider, /model, /settimezone, and /rss — to change these values. The bot writes the file automatically.