Compare commits

...

5 Commits

Author SHA1 Message Date
iCrawl
b45b99f92b chore(ws): release @discordjs/ws@0.2.0 2022-07-30 20:42:46 +02:00
DD
5137bfc17d fix(WebSocketShard): account code 1000 with no prior indication (#8399) 2022-07-30 20:37:46 +02:00
Jiralite
fca3dada2a docs(Embed): Ensure height and width are numbers (#8396) 2022-07-30 11:39:15 +02:00
Parbez
d070de6da7 chore: fix file path (#8391)
* chore: fix file path

* chore: emit only mjs
2022-07-29 18:43:57 +02:00
iCrawl
a3183cfad4 chore(discord.js): release discord.js@14.1.1 2022-07-29 13:47:21 +02:00
8 changed files with 27 additions and 15 deletions

View File

@@ -1,3 +1,3 @@
import { createUnbuildConfig } from '../../build.config';
export default createUnbuildConfig({ minify: true });
export default createUnbuildConfig({ minify: true, emitCJS: false });

View File

@@ -10,14 +10,8 @@
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
"fmt": "yarn format"
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"main": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
},
"directories": {
"lib": "src",
"test": "__tests__"

View File

@@ -11,4 +11,4 @@ outputs:
description: 'The semver string that was extracted from this tag'
runs:
using: node16
main: ../../dist/formatTag/index.js
main: ../../dist/formatTag/index.mjs

View File

@@ -1,6 +1,6 @@
{
"name": "discord.js",
"version": "14.1.0",
"version": "14.1.1",
"description": "A powerful library for interacting with the Discord API",
"scripts": {
"test": "yarn docs:test && yarn test:typescript",

View File

@@ -73,8 +73,8 @@ class Embed {
* @typedef {Object} EmbedAssetData
* @property {?string} url The URL of the image
* @property {?string} proxyURL The proxy URL of the image
* @property {?string} height The height of the image
* @property {?string} width The width of the image
* @property {?number} height The height of the image
* @property {?number} width The width of the image
*/
/**

View File

@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
# [@discordjs/ws@0.2.0](https://github.com/discordjs/discord.js/compare/@discordjs/ws@0.1.0...@discordjs/ws@0.2.0) - (2022-07-30)
## Bug Fixes
- **WebSocketShard:** Account code 1000 with no prior indication (#8399) ([5137bfc](https://github.com/discordjs/discord.js/commit/5137bfc17d763488083b76ee9008611df333272a))
# [@discordjs/ws@0.1.0](https://github.com/discordjs/discord.js/tree/@discordjs/ws@0.1.0) - (2022-07-27)
## Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@discordjs/ws",
"version": "0.1.0",
"version": "0.2.0",
"description": "Wrapper around Discord's gateway",
"scripts": {
"test": "vitest run",

View File

@@ -460,8 +460,20 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
private async onClose(code: number) {
switch (code) {
case 1000:
case 4200: {
case CloseCodes.Normal: {
this.debug([`Disconnected normally from code ${code}`]);
if (this.status === WebSocketShardStatus.Ready) {
return this.destroy({
code,
reason: 'Got disconnected by Discord',
recover: WebSocketShardDestroyRecovery.Reconnect,
});
}
break;
}
case CloseCodes.Resuming: {
this.debug([`Disconnected normally from code ${code}`]);
break;
}