examples

runnable, single-file bots in the monorepo under examples/. each is a workspace package wired to the local source, so it's also a live smoke test of the public API. clone, drop a token in .env, and run.

terminal
# from a clone of the monorepo
pnpm install

# copy the env template, then add your token(s)
cp examples/panel/.env.example examples/panel/.env

# run with reload (reads .env)
pnpm --filter @yaebal/example-panel dev

want a standalone project instead of the monorepo? scaffold one with create-yaebalpnpm create yaebal my-bot.

basic — a plugin tour

a single bot wiring most of the first-party plugins. each command demonstrates one of them. source: examples/basic.

commandwhat it shows
/starta formatted greeting with an inline keyboard (keyboard + callback-data)
/counta per-chat counter (session)
/menua two-window dialog with stack navigation (morda)
/photosends a photo by url (media)
/langtoggles the locale and replies in it (i18n)
/registera name → age wizard (scenes)
/nameasks once and handles the reply (prompt)

run it: pnpm --filter @yaebal/example-basic dev (needs BOT_TOKEN).

panel — operator dashboard

the panel end-to-end: a live operator dashboard with media in both directions, served on a native node server. it exercises the recorder, outgoing-reply logging, the login page, realtime SSE and the media proxy. source: examples/panel.

trywhat happens
send textappears live in the panel; the bot echoes it back
send a photo / document / voicerendered inline — image, download link, or audio player
send an albumgrouped into one media bubble
reply from the paneldelivered via sendMessage; 📎 uploads send as sendPhoto / sendDocument / …

run it: pnpm --filter @yaebal/example-panel dev (needs BOT_TOKEN + PANEL_TOKEN), then open http://localhost:3000 and paste the panel token.

examples are private workspace packages — they're not published to npm. they exist to run locally and to keep the public API honest as the framework evolves.