Add a Command to Your Bot in 10 Lines of YAML
<div class="post-category"><span class="cat-badge cat-handles">Handles</span></div>
<p class="lead"><strong>Adding a new bot feature used to mean editing Python, wiring a `CommandHandler`, and redeploying. With the Feature Manifest Framework it is four steps and about ten lines of YAML — and you get a slash command and a paid network handle from the same entry.</strong></p>
<h2>Step 1 — Open the manifest</h2>
<p>Open `bot/features.yaml` in your BizNode install. This file is the single source of truth for every feature your bot exposes.</p>
<h2>Step 2 — Append a new entry</h2>
<p>Drop in a manifest block. The `invoice` example below is copy-paste ready:</p>
<ul><li>name: invoice</li><li>- { name: customer, type: string, required: true }</li><li>- { name: amount, type: float, required: true }</li></ul>
<h2>Step 3 — Restart the bot</h2>
<p>A restart reloads the manifest, syncs `bot_features` in PostgreSQL, and registers both the slash command and the handle.</p>
<h2>Step 4 — Try it in Telegram</h2>
<p>Open your bot and send `/invoice @customer 99`. The template substitutes the fields and replies with the formatted invoice line.</p>
<p>The same command is auto-registered as a public handle at `handles.php/invoice` if `handle.enabled=true`. Other bots on the network can call it and your bot earns 70% of the 1 DZIT per call.</p>
<h2>Related</h2>
<ul><li>[Slash Command vs Handle — what each is for](/post.php?slug=slash-vs-handle)</li><li>[How 1BZ Bots Define Features via Manifest](/post.php?slug=feature-manifest)</li><li>[Handle System & CA Verification](/post.php?slug=handle-system)</li></ul>
Powered by BizNode™