Troubleshooting
Having issues with BotBox or your Discord bot project?
Here are solutions to common problems.
Missing botbox.conf
If you see errors about a missing config file, run:
botbox initThis will generate a new botbox.conf in your project directory.
Missing Global Config
If you see errors about missing global config, just run any BotBox command (e.g., botbox) to auto-generate it.
Legacy Config Format
If your botbox.conf looks like this (pre-2.5.0):
{
"cogs": [
{
"name": "HelloWorld",
"file": "helloWorld",
"env": "development",
"slash_commands": ["hello"],
"prefix_commands": []
}
]
}You should upgrade to the new format:
{
"cogs": [
{
"name": "HelloWorld",
"file": "helloWorld",
"env": "development",
"slash_commands": [
{
"Name": "hello",
"Scope": "guild",
"Type": "slash",
"Description": "Bot responds with world",
"Args": [],
"ReturnType": "None"
}
],
"prefix_commands": []
}
]
}To upgrade, run:
botbox project upgradeCogs Not Loading
Make sure cog names in
botbox.confmatch the actual file names insrc/cogs/.Ensure the cog files exist.
Check that your
ENVIRONMENTSvariable (in.envor Doppler) includes the environment(s) for the cogs you want to load.Run:
shbotbox config syncto synchronize your config with your cog files.
Token Errors
Ensure your
.envfile exists and contains:envDISCORD_TOKEN=your-bot-token-here DISCORD_GUILD=your-guild-id-hereIf using Doppler, check your secrets are set in the correct project/environment.
Update Issues
If automatic updates fail, try:
botbox updatebotbox update installs with go install, so it needs Go on your machine. Homebrew installs update with brew upgrade botbox, and prebuilt binaries are replaced by hand from the releases page.
If the update reports that it installed to one path while the botbox you are running lives at another, you have two copies installed. Check your PATH order or delete the older copy.
Two Versions Installed
Run which -a botbox to see every copy on your PATH. A Homebrew install at /opt/homebrew/bin/botbox and a go install copy at $(go env GOPATH)/bin/botbox can shadow each other, and whichever comes first in PATH wins.
Headless Command Fails Immediately
--authoris required and falls back touser.default_user, so either pass the flag or runbotbox config set -g user.default_user "your name".--doppler-projectis required when you pass--env doppler.- A token is required when you pass
--env env, from--tokenorBOTBOX_TOKEN. botbox removewithout a cog name fails, headless mode has no list to pick from.- Errors go to stderr, so if a pipeline looks silent check that you are not swallowing stderr.
See Headless Mode.
Configuration Issues
- Use
botbox config listto view all current settings. - Use
botbox config list -gfor global settings.
CLI Panics or Crashes
- Make sure you’re running the latest version (
botbox update). - Check that your project structure is valid.
Still Stuck?
- Check the BotBox documentation
- Open an issue on GitHub