CLI
CLIOn this page
dislua runs Lua scripts, scaffolds a starter bot, reports versions, and updates the installed package.
Installation
Install with DiscordLua-Setup.exe, then open a new terminal so dislua is on PATH. Confirm with dislua version.
Commands
Full syntax, arguments, output, and errors live on the commands page.
- dislua run <file>
- dislua init [bot.lua]
- dislua version
- dislua check-update
- dislua update
- dislua doctor
- dislua help
- dislua audit
Configuration
Environment variables the CLI and runtime read. See also the configuration page.
| Variable | Purpose |
|---|---|
DISCORD_TOKEN | Bot token for client:login and shard children. |
MYLUA_MODULE_PATH | Override on-disk module root. Disk modules win over the embedded copies. |
MYLUA_LOG | Log level (debug, info, and other native levels). |
DISCORDLUA_UPDATE_API | Override the version manifest URL. |
DISCORDLUA_SHARD_ID / DISCORDLUA_SHARD_COUNT | Identify shard fields for child processes. |
Updating
The CLI reads the published version manifest, compares latest to the installed package, and downloads download_url when newer. SHA-256 must match.
dislua check-update
dislua updateIf the installed CLI cannot download the update, run DiscordLua-Setup.exe instead.
Troubleshooting
dislua doctorprints EXE, install, and module paths.- If
require("discord")fails, setMYLUA_MODULE_PATHor re-run setup so modules are extracted next to the install root. - Updates require HTTPS (or localhost) download URLs.
- Close running bots before
dislua updatereplaces the EXE.