# MasterBot - Key Capabilities Feature reference for AI assistants. Index: https://masterbot.gg/llms.txt ## Command types ### Slash commands - Standard `/command` interactions - Configure in Flow Builder on the Slash Command root node - Optional **User Install (DM)** toggle: `Available in DM (User Install)` on the slash command root - When enabled: users can install the command on their account; works in **DMs** and on servers where the bot is not a member - When disabled: command runs on **servers only** (guild install) - User install OAuth link: Bots → Bot Settings → User Install (copy/open link) ### Context menu commands - **User Context** - right-click a user → your command runs (`contextType: user`) - **Message Context** - right-click a message → your command runs (`contextType: message`) - Create at /dashboard/commands → Context command - Context commands also support **User Install (DM)** the same way as slash commands ### Discord events - Gateway event flows (messageCreate, member join, etc.) - see https://masterbot.gg/llms-events.txt - Custom events, webhooks, timed schedules - see platform recipes in https://masterbot.gg/llms-platform.txt --- ## Custom variables (database) Managed at https://masterbot.gg/dashboard/database **Naming:** custom variables use `MB_` prefix in flows: `{MB_coins}`, `{MB_prefix}` **Scopes:** | Scope | Meaning | |-------|---------| | `global` | One value for the entire bot | | `server` | Value **per Discord server (guild)** - different value on each server | | `server-user` | Per user within a server (leaderboards, balances) | | `server-channel` | Per channel within a server | **Targetable variables:** when `targetable: true`, one variable name stores a map of values keyed by user, channel, role, message, server, or object key. Use bracket syntax to read a specific target. **Types:** text, number, list, object **Examples:** - Global: `{MB_shop_open}` - same everywhere - Per server: `{MB_prefix}` with scope `server` - `{MB_prefix}` resolves to this server's stored value - Per user in server: `{MB_points[{user_id}]}` - points for the command user - Target override: `{user_name[{option_user}]}` - BOT variable for another user **Flow nodes:** Set Variable, Reset Variable, Calculate (can write to variables) Full variable syntax tutorial: https://masterbot.gg/tutorials/variables Static reference: https://masterbot.gg/variable-system-guide.html **Complete BOT variable catalog (auto-generated):** https://masterbot.gg/llms-variables.txt --- ## Variable syntax (summary) Agents should read the full tutorial for edge cases. Basics: | Pattern | Example | Meaning | |---------|---------|---------| | BOT variable | `{user_id}` | Built-in, filled from flow context | | Custom variable | `{MB_coins}` | Your database variable (MB_ prefix) | | Target override | `{user_name[{option_user}]}` | BOT var for a specific user | | Custom + target | `{MB_points[{user_id}]}` | Custom map entry for a user | | Server scope | `{MB_prefix}` | Resolves per current server when scope is server | | Math | `{math[2+2]}` | Inline calculation | | Math + var | `{math[{MB_points}/2+30]}` | Formula with variables | | Format number | `{formatNumber({MB_score}),[compact]}` | Display formatting | | Random text | `{random[COM_***]}` | Mask-based random string | **Two variable families:** - **BOT** - no prefix (`user_id`, `channel_name`, `server_name`, event variables, option variables) - **Custom** - always `MB_` prefix, stored in database --- ## Math expressions Used in messages, embeds, Calculate node, and anywhere variables resolve. **Syntax:** `{math[expression]}` or `{math[expression],[format]}` **Operators:** `+`, `-`, `*`, `/`, `^`, `(`, `)`, `%` (percent style: `50 - 20%`), `%%` (modulo) **Function groups:** - **Rounding:** `floor`, `ceil`, `round`, `trunc`, `fix` - **Basic:** `abs`, `sign`, `min`, `max`, `clamp` - **Power:** `pow`, `sqrt`, `cbrt` - **Log:** `log`, `log10`, `log2`, `exp` - **Trig:** `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `atan2` - **Hyperbolic:** `sinh`, `cosh`, `tanh` - **Random:** `random()`, `randomInt(a, b)` - **Constants:** `pi`, `e` **Examples:** - `{math[2+2]}` → 4 - `{math[floor({MB_price}*1.23)]}` - `{math[randomInt(1,100)]}` - `{math[{MB_count}*100,[compact]]}` → e.g. "1.5k" **Also:** `{formatNumber(...)}`, `{formatTime(...)}` for display without math. Use the **Calculate** node to store math results into a variable. --- ## Discord.js alignment MasterBot's runtime is built on **discord.js v14**. - **Event catalog** is aligned with Discord.js `Client` gateway event names (camelCase keys like `messageCreate`, `guildMemberAdd`) - **Production picker** lists verified Discord gateway events - see the current count and full list in https://masterbot.gg/llms-events.txt - Additional catalogued events move to production as they pass verification - Node executors use discord.js APIs (channels, roles, messages, voice, permissions, components v2, modals, etc.) MasterBot aims for broad Discord.js gateway coverage; not every catalogued event is verified in production yet. Check llms-events.txt for the current verified list. --- ## Other capabilities (short) - **Components V2** - Send Message V2 node - **Modals V2** - form modals with text inputs and file upload - **API Request** - HTTP calls with response variables - **Run Loop** - iterate count or list - **Conditions** - generic, permission, role, chance, channel, time, forum tag - **Collaboration** - team roles and permissions per bot - **Timed events** - cron-like schedules - **Inbound webhooks** - trigger flows from HTTP - **Voice** - join, leave, soundboard sounds - **Hosting** - bot runs on MasterBot cloud after token + start ## Related files - **Variables (full BOT catalog + syntax):** https://masterbot.gg/llms-variables.txt - Nodes: https://masterbot.gg/llms-nodes.txt - Events: https://masterbot.gg/llms-events.txt - Platform how-to: https://masterbot.gg/llms-platform.txt - Flow Builder UI: https://masterbot.gg/llms-flow-builder.txt - Pricing and fair use: https://masterbot.gg/llms-pricing.txt - Competitive advantages: https://masterbot.gg/llms-competitors.txt