discord-slim
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -37,2 +37,3 @@ /// <reference types="node" /> | ||
on(event: 'error', listener: (this: this, message: string) => void): this; | ||
on(event: 'fatal', listener: (this: this, message: string) => void): this; | ||
addListener(event: 'connect', listener: (this: this) => void): this; | ||
@@ -48,2 +49,3 @@ addListener(event: 'disconnect', listener: (this: this, code: number) => void): this; | ||
addListener(event: 'error', listener: (this: this, message: string) => void): this; | ||
addListener(event: 'fatal', listener: (this: this, message: string) => void): this; | ||
off(event: 'connect', listener: (this: this) => void): this; | ||
@@ -59,2 +61,3 @@ off(event: 'disconnect', listener: (this: this, code: number) => void): this; | ||
off(event: 'error', listener: (this: this, message: string) => void): this; | ||
off(event: 'fatal', listener: (this: this, message: string) => void): this; | ||
removeListener(event: 'connect', listener: (this: this) => void): this; | ||
@@ -70,2 +73,3 @@ removeListener(event: 'disconnect', listener: (this: this, code: number) => void): this; | ||
removeListener(event: 'error', listener: (this: this, message: string) => void): this; | ||
removeListener(event: 'fatal', listener: (this: this, message: string) => void): this; | ||
once(event: 'connect', listener: (this: this) => void): this; | ||
@@ -81,4 +85,5 @@ once(event: 'disconnect', listener: (this: this, code: number) => void): this; | ||
once(event: 'error', listener: (this: this, message: string) => void): this; | ||
once(event: 'fatal', listener: (this: this, message: string) => void): this; | ||
removeAllListeners(): this; | ||
removeAllListeners(event: 'connect' | 'disconnect' | 'packet' | 'warn' | 'error'): this; | ||
removeAllListeners(event: 'connect' | 'disconnect' | 'packet' | 'warn' | 'error' | 'fatal'): this; | ||
} | ||
@@ -85,0 +90,0 @@ export declare const Routes: { |
@@ -33,3 +33,3 @@ "use strict"; | ||
if (!(gateway && (typeof gateway.url == 'string'))) | ||
throw 'Unable to connect: unexpected gateway API response.'; | ||
return this.emit('fatal', 'Unable to connect: unexpected gateway API response.'); | ||
this.#ws = new WebSocket(gateway.url); | ||
@@ -36,0 +36,0 @@ this.#ws.on('message', this.#OnMessage); |
{ | ||
"name": "discord-slim", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Lightweight Discord client for Node.js.", | ||
@@ -20,3 +20,3 @@ "author": "Hanabishi", | ||
"dependencies": { | ||
"ws": "^7.3.0" | ||
"ws": "^7.3.1" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
# Discord Slim | ||
[![npm version](https://badge.fury.io/js/discord-slim.svg)](https://www.npmjs.com/package/discord-slim) | ||
[![npm](https://img.shields.io/npm/v/discord-slim?style=for-the-badge)](https://www.npmjs.com/package/discord-slim) | ||
@@ -29,4 +29,5 @@ Lightweight **Discord** client for **Node.js**. | ||
* `packet` - intent packet received. | ||
* `error` - some error happened. | ||
* `warn` - other noticeable information. | ||
* `error` - error appeared, client will continue to work. | ||
* `fatal` - fatal error, client will shutdown. | ||
@@ -33,0 +34,0 @@ ### Other exports |
26810
554
83
Updatedws@^7.3.1