Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ccbluex/axochat-client
JavaScript API client for AxoChat
https://github.com/ccbluex/axochat-client
Last synced: about 11 hours ago
JSON representation
JavaScript API client for AxoChat
- Host: GitHub
- URL: https://github.com/ccbluex/axochat-client
- Owner: CCBlueX
- License: osl-3.0
- Created: 2021-04-07T09:02:44.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-23T21:50:41.000Z (8 months ago)
- Last Synced: 2024-05-01T17:53:25.017Z (6 months ago)
- Language: TypeScript
- Size: 173 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
```typescript
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}`);
});
});
```