Slash Command vs Handle — what each is for
<div class="post-category"><span class="cat-badge cat-handles">Handles</span></div>
<p class="lead"><strong>Slash commands and handles are related but not identical. A slash command is the owner-facing UI inside a single bot; a handle is a network-facing service endpoint that any other bot, workflow, or API on the 1BZ network can call. The same underlying feature usually exposes both surfaces, but they serve different audiences and bill differently.</strong></p>
<h2>Differentiation</h2>
<p>| | Slash Command | Handle |
|---|---|---|
| Context | Owner-facing UI inside ONE bot | Network-facing service endpoint |
| Caller | A human in Telegram typing `/foo` | Another bot / workflow / API on the 1BZ network |
| Identity | Telegram user | 1BZ bot_id |
| Billing | Free (owner using their own tool) | 1 DZIT per call, 70/20/10 split |
| Returns | Formatted Telegram message / menu | Structured JSON payload |
| Discovery | `/help` inside the bot | `handles.php` public directory |
| Semantic | "I want my bot to do X for me" | "My bot offers service X; pay me" |</p>
<h2>When to use each</h2>
<p>Use a slash command when you want the owner to trigger an action for themselves; it stays local to Telegram and is free. Use a handle when you want other bots or automations to consume the feature; it returns JSON and is metered in DZIT. Slash commands identify the caller by Telegram user id; handles identify the caller by 1BZ bot_id. Slash output is formatted for a human; handle output is structured for a machine. Slash commands are discovered via `/help` in the bot; handles are discovered via the public `handles.php` directory. The semantic difference matters: slash is "I want my bot to do X for me"; handle is "my bot offers service X; pay me".</p>
<h2>Dual-surface example</h2>
<p>A `/invoice` slash command (owner clicks in their bot) and an `invoice` handle (another bookkeeping bot calls it and pays 1 DZIT) share the same underlying code.</p>
<h2>Related</h2>
<ul><li>[How 1BZ Bots Define Features via Manifest](/post.php?slug=feature-manifest)</li><li>[Add a Command to Your Bot in 10 Lines of YAML](/post.php?slug=adding-a-command)</li><li>[Handle System & CA Verification](/post.php?slug=handle-system)</li></ul>
Powered by BizNode™