Yurst

Quick Start

Getting started with Yurst

Introduction to Yurst

Complete documentation for the Yurst library for creating bots on Node.js for the Yurba.one platform.

Yurst provides a singleton bot on which you register commands, callback buttons, and event handlers, while everything else (connection, retries, deduplication, command list synchronization) is handled by the library itself.

Requirements

Basic knowledge of JavaScript, Node.js 22 or newer, and an account on Yurba.one.

What Yurst can do

  • Commands in short and object form, automatic synchronization of the list with Yurba.
  • Callback buttons with simple prefix-based routing.
  • Inline buttons (data, url, copy, command) and reply keyboards.
  • Inline queries, message editing, typing indicator.
  • Updates via WebSocket with automatic fallback to long polling.
  • No runtime dependencies, ESM only.

First bot

Install Node.js

Download Node.js version 22 or newer and verify it:

node --version

Create a bot

Go to the developer settings, create a new bot, and save its token.

Important

Do not give anyone access to the token. Do not publish it in repositories.

Create a project

npm init -y

Yurst is an ESM package, so add the line "type": "module" to package.json:

package.json
{
  "name": "my-bot",
  "type": "module"
}

Install Yurst

npm install yurst.js

Add the token

Create a .env file in the project root:

.env
TOKEN=b.your_bot_token
MODE=ws 

Do not forget to add .env to .gitignore.

Write the code

src/index.js
import { bot } from 'yurst.js';

bot.command('ping', 'Connection check', (ctx) => ctx.reply('pong'));
bot.command('help', 'List of commands', (ctx) => ctx.reply(ctx.help()));

await bot.start();

Run the bot

node --env-file=.env src/index.js

Open the chat with the bot on Yurba.one and send /ping. If you receive pong in response, everything works.

Where to go next

On this page