Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

adamant-botfactory

martiliones21GPL-3.00.2.10TypeScript support: included

ADAMANT Bot Framework

adm, adamant

readme

botfactory

Minimalist bot framework for ADAMANT.

Installation

You can install it using one of the popular package managers, e.g. using npm:

npm install adamant-botfactory

Example

import { createBot } from "adamant-botfactory";

const nodes = [
  "http://localhost:36666",
  "https://endless.adamant.im",
  // ...
];

const bot = createBot(process.env.PASS_PHRASE, {
  nodes,
});

bot.command("start", async (usr) => {
  const res = await usr.balance();

  usr.reply(`Hello! Your balance is ${res.balance}.`);
});

bot.start();