Configuration¶
This page is about the global bot configuration. For per-guild configuration, refer to the (other) Configuration page.
Info
Changes to environment variables or the main configuration file require a restart to take effect.
If you aren't using a panel or other daemonisation method to run the bot,
type exit
or press Ctrl+C a couple of times to kill the process.
Environment variables¶
In most cases, the environment variables can be set by editing the .env
file (which the bot creates for you if you follow the installation instructions).
The installation guides also explain where to find most of the environment variable values.
Danger
Keep your environment variables safe.
Your Discord token
and secret
are extremely dangerous in the wrong hands,
and your database is useless if you lose the encryption key.
These example values are fake; do not share real values (in version control, pastes, screenshots, etc).
Example
.env | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
DB_CONNECTION_URL
¶
Conditionally optional
The MySQL or PostgreSQL database connection string. If you are using SQLite, this is not required.
Example
.env | |
---|---|
1 |
|
.env | |
---|---|
1 |
|
.env | |
---|---|
1 |
|
DB_PROVIDER
¶
The type of database the bot will use; one of:
mysql
(recommended, use this for MariaDB too)postgresql
sqlite
DISCORD_SECRET
¶
Your Discord application's secret key, used for OAuth2. Follow the installation guides to find this.
DISCORD_TOKEN
¶
Your Discord application's authentication token. Follow the installation guides to find this.
ENCRYPTION_KEY
¶
The key used for encrypting data in the database and signing JWTs (authentication cookies).
This is usually generated for you automatically.
You can also run npm run keygen
to generate a new key,
or use this generator:
Click to regenerate
|
|
Danger
Keep this safe! If someone manages to get access to your database (or a dump/backup) and they have the encryption key, your users' messages will be readable. Similarly, if you lose this key, you will need to completely reset the database.
HTTP_EXTERNAL
¶
Default: http://127.0.0.1:8169
The full external URL used to access the bot's API or settings panel.
Example
.env | |
---|---|
6 |
|
HTTP_HOST
¶
Default: 0.0.0.0
The interface that the integrated web server will listen on. The default accepts connections from anywhere (assuming your firewall allows it).
HTTP_PORT
¶
Default: 8169
Info
Ports lower than 1024 may require running as root to bind to.
The port number that the integrated web server will bind to.
HTTP_TRUST_PROXY
¶
Optional ·
Default: false
If you are running the bot behind a reverse proxy, set this to true
(must be lowercase) to trust the X-Forwarded-
headers.
INVALIDATE_TOKENS
¶
Optional
A timestamp (e.g. 2023-03-12T21:50:39.267Z
) which any API service key (not user tokens) must be created after in order to be accepted.
If a service key is leaked, set this to the current time to invalidate all existing keys.
OVERRIDE_ARCHIVE
¶
Optional
When set to false
(must be lowercase), guilds' archive
setting will be ignored, disabling the archive feature for all guilds.
PUBLIC_BOT
¶
Optional ·
Default: false
You should keep this as false
.
PUBLISH_COMMANDS
¶
Optional ·
Default: false
When set to true
(must be lowercase), commands will automatically be published to Discord.
Enabling this is not recommended if you are going to restart your bot frequently,
but it is useful for removing the need to publish the commands manually when you install or update the bot.
SUPER
¶
Optional ·
Default: 319467558166069248
A comma-separated list of Discord user IDs that have elevated privileges. These users (typically the bot owners) are allowed to manage the settings of any guild, regardless of their roles or permissions in that guild.
Recommendation
If you keep the default (319467558166069248
), I can help you without you needing to give me administrator permissions in your guild.
You can also add your own ID:
.env | |
---|---|
15 |
|
Main configuration file¶
The main configuration file is located at user/config.yml
.
If it doesn't exist, run the bot and it will be generated for you.
Example
user/config.yml | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
logs
¶
files
¶
directory
¶
Default: ./logs
The directory to store log files in, if log file are enabled.
enabled
¶
Default: true
If logs should be saved to files. This is recommended but can be disabled if for example you are using a panel which already does this.
keepFor
¶
Default: 30
The number of days to keep log files for before deleting them (to save disk space), if log files are enabled.
level
¶
Default: info
The minimum log level that should be logged.
Must be one of:
debug
verbose
info
(recommended)success
warn
notice
error
critical
presence
¶
activities
¶
An array of activities (length must be at least 1).
name
¶
The activity name, which may contain these placeholders:
{avgResolutionTime}
{avgResponseTime}
{openTickets}
{totalTickets}
type
¶
Optional ·
Default: 0
The activity type (playing, watching etc).
Types: https://discord-api-types.dev/api/discord-api-types-v10/enum/ActivityType.
interval
¶
Default: 20
The number of seconds to show each activity before rotating.
status
¶
Default: online
The bot's status, one of:
online
idle
invisible
dnd
stats
¶
Default: true
If stats should be posted to the Discord Tickets StatsAPI.
Terms of service and Privacy policy apply.
templates
¶
transcript
¶
Default: transcript.md
The (partial) name of the file, relative to user/templates
, that contains the Mustache template for text transcripts.
The actual file must have the .mustache
file extension appended to the end of this name (transcript.md
→ transcript.md.mustache
).
The generated transcript file's type/extension comes from the second dot-separated segment of the file name,
so if you want users to download .log
or .txt
file instead of .md
,
you would change this option to transcript.txt
and rename the file to transcript.txt.mustache
.