mixer-chat-client

1.3.2 • Public • Published

Mixer Chat Client

This is a simple, bare-bones, and fast javascript chat client for Mixer.com.

It works on both front-end and back-end javascript/node projects.

It is currently in use powering every chat connection over at https://pixel.chat

Installation:

With yarn:

yarn add mixer-chat-client

With npm:

npm i mixer-chat-client --save

Usage:

const chatClient = require("mixer-chat-client");

// You will have to get the correct chat server yourself from the mixer API

//Arguments are: Chat server URI, channelID, userID(optional), authToken(optional)
let Chat = new chatClient("wss://chat.mixer.com:443", 60302, 85878, "asdf1234");

Chat.on("connect", () => {
  console.log("connected");
});

Chat.on("welcome", () => {
  console.log("Recieved welcome event, shutting down");
  Chat.close();
});

Chat.connect();

Events:

Event Data
msg, whisper {message: [], username: "", level: 00, roles: [], chatId: "", userId: 00, meta: {}, chatLevel: 00}
clear {}
purge {userId: 00}
delete {chatId: ""}
userJoin {username: "", roles: [], channel: 00, id: 00}
userLeave {username: "", roles: [], channel: 00, id: 00}
welcome {}

Methods:

Method Arguments Response
connect
send type, method, args[] Promise
close

Readme

Keywords

none

Package Sidebar

Install

npm i mixer-chat-client

Weekly Downloads

0

Version

1.3.2

License

MIT

Unpacked Size

7.6 kB

Total Files

5

Last publish

Collaborators

  • acpixel