flowee-chat

0.2.0 • Public • Published

flowee-chat

Simple module for communicating with the chat of a Flowee stream

Example

const FloweeChat = require('flowee-chat');
const chat = new FloweeChat('ws://flowee.ru/api', '645532b4be16383418ce36cb');
(async () => {
  console.log('Connecting...');
  await chat.connect();
  console.log('Connected!');
  chat.on('message', function(data){
    console.log('New message!', data);
    // New message! {
    //   timestamp: 1684237159,
    //   username: 'AppData 174',
    //   avatar: 'default',
    //   message: 'Тевирп'
    // }
  });
  setTimeout(async () => {
    console.log('Closing the connection...');
    await chat.disconnect();
  }, 15000);
})();

Install

This module requires Node.js >=10.0.0.

Install via npm:

npm install flowee-chat

or yarn:

yarn add flowee-chat

Usage

// to-do

Package Sidebar

Install

npm i flowee-chat

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

4.21 kB

Total Files

4

Last publish

Collaborators

  • gohoski