bolt-chat.js

0.4.0 • Public • Published

bolt-chat.js

Node.JS library for interacting with the bolt.chat protocol, made in TypeScript.

Installation

yarn add bolt-chat.js

Usage

import { Bolt } from 'bolt-chat.js';
import { join } from 'path';

const bolt = new Bolt({
  identity: {
    username: 'boltbot',
    privKeyFile: join(__dirname, '..', 'private.pgp'),
    pubKeyFile: join(__dirname, '..', 'public.pgp')
  }
});

async function bootstrap(): Promise<void> {
  await bolt.servers.join(
    {
      host: 'bolt.stingalleman.dev'
    },
    (server) => {
      console.log(`Connected to ${server.config.host}!`);
    }
  );

  bolt.on('msg', (msg) => {
    console.log(`${msg.author.nickname} said: ${msg.content}`);
  });
}

bootstrap();

Author

Sting Alleman

Credits & special thanks

Stijn van der Kolk - Has made the entire events system & the server manager. (#10)

This library is inspired by Jip Frijlink

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i bolt-chat.js

Weekly Downloads

0

Version

0.4.0

License

MIT

Unpacked Size

975 kB

Total Files

90

Last publish

Collaborators

  • stingalleman