2.0.0 • Published 5 years ago

yacqhttp v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

English - 中文

yacqhttp

npm version build status coverage status GitHub license

This is a lightweight Node.js package that allows you to interact with the CoolQ HTTP API. It can only act as the WebSocket server at the moment. Other methods of communication are not supported.

Features

  • Full TypeScript support.
  • Simple and easy to use.
  • Load balancing between multiple CoolQ instances.

Installation

This package requires Node.js v10 or newer and CQHTTP API v4.5.0 or newer.

$ npm install yacqhttp

Usage example

const { Server } = require('yacqhttp');
const coolQ = new Server();

coolQ
  .on('ready', client => console.log(`${client.id} is ready!`))
  .on('message', (client, event) => client.send(event, 'Hi~'));

coolQ.listen('0.0.0.0', 8080);

With CommandRegistry

// Previous example here...

const { CommandRegistry } = require('yacqhttp');
const cmdReg = new CommandRegistry(coolQ);

cmdReg.add({
  name: 'echoFirstWord',
  process(convo, args) {
    convo.reply(`Your first word is: ${args[0]}`);
  },
});

Documentation

See https://zyntuz.github.io/yacqhttp.

2.0.0

5 years ago

2.0.0-alpha.8

5 years ago

2.0.0-alpha.7

5 years ago

2.0.0-alpha.6

5 years ago

2.0.0-alpha.5

5 years ago

2.0.0-alpha.4

5 years ago

2.0.0-alpha.3

5 years ago

2.0.0-alpha.2

5 years ago

2.0.0-alpha.1

5 years ago

2.0.0-alpha.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.5.0

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago