discord-slim
Advanced tools
Comparing version 2.0.0-dev.1 to 2.0.0-dev.2
@@ -148,3 +148,6 @@ "use strict"; | ||
this._wsDisconnect(code); | ||
this._wsConnect(true); | ||
if (code < 4000) | ||
this._wsConnect(true); | ||
else | ||
this.emit('fatal', `Fatal gateway error. Code: ${code}`); | ||
}; | ||
@@ -151,0 +154,0 @@ this._onError = (error) => this.emit('error', error); |
{ | ||
"name": "discord-slim", | ||
"version": "2.0.0-dev.1", | ||
"version": "2.0.0-dev.2", | ||
"description": "Lightweight Discord client for Node.js.", | ||
@@ -10,2 +10,3 @@ "author": "Hanabishi", | ||
}, | ||
"discord": "https://discord.gg/drsXkP8R4h", | ||
"main": "./dist/index.js", | ||
@@ -12,0 +13,0 @@ "types": "./dist/index.d.ts", |
# Discord Slim | ||
### V2 IS UNDER DEVELOPMENT! | ||
Contains breaking changes and incompatible with V1. | ||
Dev version is unstable and can have bugs! | ||
API is unfinished and may be changed with further updates. | ||
@@ -19,3 +20,3 @@ | ||
## Installation | ||
### Note: this version is unstable! | ||
### Note: NPM version may be out-of-date and not contain latest repo commits. | ||
``` | ||
@@ -36,6 +37,18 @@ npm i discord-slim@dev | ||
client.on('connect', () => console.log('Connection established.')); | ||
client.on('disconnect', (code) => console.error(`Disconnect. (${code})`)); | ||
client.on('warn', console.warn); | ||
client.on('error', console.error); | ||
client.on('fatal', (e) => { console.error(e); process.exit(1); }); | ||
client.events.on(Events.MESSAGE_CREATE, (message) => { | ||
if(message.author.id == client.user.id) return; | ||
if(message.content.toLowerCase().indexOf('hello bot') < 0) return; | ||
Actions.Message.Create(message.channel_id, { content: `Hi, <@${message.author.id}>!` }, requestOptions); | ||
Actions.Message.Create(message.channel_id, { | ||
content: `Hi, <@${message.author.id}>!`, | ||
message_reference: { | ||
channel_id: message.channel_id, | ||
message_id: message.id, | ||
}, | ||
}, requestOptions); | ||
}); | ||
@@ -42,0 +55,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
117568
2488
59
1