Node.JS library for interacting with the bolt.chat protocol, made in TypeScript.
yarn add bolt-chat.js
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();
Stijn van der Kolk - Has made the entire events system & the server manager. (#10)
This library is inspired by Jip Frijlink