37 lines
1.7 KiB
Markdown
37 lines
1.7 KiB
Markdown
# Choose a track
|
|
|
|
Every TabBot bot is **Visual** or **Code**. The runner only executes the active track. Official modules, the vault, intents, and the runner tab are shared.
|
|
|
|
You pick a track in **Studio → New bot**. Settings can switch later; the unused tree is kept but not run.
|
|
|
|
## Visual
|
|
|
|
No-code. Studio shows **Builder**, not Code. The runner:
|
|
|
|
- registers `/ping` plus slash commands (and their option children) from the visual IR
|
|
- `interpret()`s command trees, gateway event roots, and modal submits
|
|
- does **not** compile TypeScript
|
|
|
|
Start: [Visual builder tour](/docs/guide/visual-builder).
|
|
|
|
## Code
|
|
|
|
Multi-file TypeScript in the Code studio. Studio shows **Code**, not Builder. The runner:
|
|
|
|
- bundles `index.ts` and relative imports with **esbuild-wasm** (no npm install)
|
|
- calls `export default async function main(client)`
|
|
- registers `export const commands` plus enabled module commands
|
|
- does **not** interpret IR and does **not** auto-register `/ping`
|
|
|
|
You write discord.js **names** (`Events`, `SlashCommandBuilder`, `EmbedBuilder`). TabBot still constructs `new Client({ intents })` and calls `login(token)`. Do not put the token in source. `new Client()` in your files is unsupported.
|
|
|
|
Start: [Code studio](/docs/guide/code-studio).
|
|
|
|
## Modules
|
|
|
|
[Modules](/docs/guide/modules) register on the same Client in both tracks. Disable overlapping slash names if your code also handles them — the module wins registration.
|
|
|
|
## Switching
|
|
|
|
Settings → **Switch to Code / Visual**. Visual → Code writes the IR into `ejected.ts` and into `index.ts` if the file tree has no entry. **Eject to code** on Builder / Modules / Code studio does the same without requiring a track switch when you are already on Code (`index.ts` is left alone). Code → Visual leaves the IR as-is.
|