soop-chat-client
Version:
SOOP Live Chat Client
41 lines (28 loc) • 649 B
Markdown
SOOP Chat Client for node.js
`npm i soop-chat-client`
or
`yarn add soop-chat-client`
```js
import { SoopChatClient } from 'soop-chat-client';
const client = new SoopChatClient({
logging: false,
});
client.on('join', (channel) => {
console.log(`Joined to ${channel}`);
});
client.on('part', (channel) => {
console.log(`Parted from ${channel}`);
});
client.on('chat', (chat) => {
console.log(`${chat.nickname}(${chat.userId}): ${chat.content}`);
});
// join
client.connect('channel id');
// join a password-protected room
client.connect('channel id', 'password');
// part
client.close();
```