Skip to content

CCBlueX/axochat-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AxoChat Client

NPM Package: https://www.npmjs.com/package/@ccbluex/axochat-client

Example Usage

The LiquidBounce chat's certificate is self-signed, so you need to disable the certificate verification.

import { Client } from '@ccbluex/axochat-client';

const client = new Client();

client.connect('wss://chat.liquidbounce.net:7886/ws');

client.on('open', () => {
  console.log('Connected!');

  client.loginJWT('TOKEN', true);

  client.on('success', ({ reason }) => {
    if (reason === 'Login') {
      client.on('message', (data) => {
        console.log(`${data.author.name}: ${data.content}`);
      });

      client.on('privateMessage', (data) => {
        console.log(`[PRIVATE] ${data.author.name}: ${data.content}`);
      });

      client.sendMessage('Hello, World!');
    }
  });

  client.on('error', ({ message }) => {
    console.log(`[ERROR] ${message}`);
  });
});

About

JavaScript API client for AxoChat

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •