mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 08:03:30 +01:00
chore(Deps): upgrade deps (#4701)
This commit is contained in:
@@ -26,7 +26,8 @@
|
|||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"quoteProps": "as-needed",
|
"quoteProps": "as-needed",
|
||||||
"trailingComma": "all",
|
"trailingComma": "all",
|
||||||
"endOfLine": "lf"
|
"endOfLine": "lf",
|
||||||
|
"arrowParens": "avoid"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"strict": ["error", "global"],
|
"strict": ["error", "global"],
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,7 +1,6 @@
|
|||||||
# Packages
|
# Packages
|
||||||
node_modules/
|
node_modules/
|
||||||
yarn.lock
|
yarn.lock
|
||||||
package-lock.json
|
|
||||||
|
|
||||||
# Log files
|
# Log files
|
||||||
logs/
|
logs/
|
||||||
|
|||||||
11262
package-lock.json
generated
Normal file
11262
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
46
package.json
46
package.json
@@ -22,7 +22,7 @@
|
|||||||
"lint": "eslint src",
|
"lint": "eslint src",
|
||||||
"lint:fix": "eslint src --fix",
|
"lint:fix": "eslint src --fix",
|
||||||
"lint:typings": "tslint typings/index.d.ts",
|
"lint:typings": "tslint typings/index.d.ts",
|
||||||
"prettier": "prettier --write --single-quote --print-width 120 --trailing-comma all --end-of-line lf src/**/*.js typings/**/*.ts",
|
"prettier": "prettier --write --single-quote --print-width 120 --trailing-comma all --end-of-line lf --arrow-parens avoid src/**/*.js typings/**/*.ts",
|
||||||
"build:browser": "webpack",
|
"build:browser": "webpack",
|
||||||
"prepublishOnly": "npm run test && cross-env NODE_ENV=production npm run build:browser"
|
"prepublishOnly": "npm run test && cross-env NODE_ENV=production npm run build:browser"
|
||||||
},
|
},
|
||||||
@@ -47,37 +47,37 @@
|
|||||||
"runkitExampleFilename": "./docs/examples/ping.js",
|
"runkitExampleFilename": "./docs/examples/ping.js",
|
||||||
"unpkg": "./webpack/discord.min.js",
|
"unpkg": "./webpack/discord.min.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/collection": "^0.1.5",
|
"@discordjs/collection": "^0.1.6",
|
||||||
"@discordjs/form-data": "^3.0.1",
|
"@discordjs/form-data": "^3.0.1",
|
||||||
"abort-controller": "^3.0.0",
|
"abort-controller": "^3.0.0",
|
||||||
"node-fetch": "^2.6.0",
|
"node-fetch": "^2.6.0",
|
||||||
"prism-media": "^1.2.0",
|
"prism-media": "^1.2.2",
|
||||||
"setimmediate": "^1.0.5",
|
"setimmediate": "^1.0.5",
|
||||||
"tweetnacl": "^1.0.3",
|
"tweetnacl": "^1.0.3",
|
||||||
"ws": "^7.2.1"
|
"ws": "^7.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^8.3.5",
|
"@commitlint/cli": "^9.1.2",
|
||||||
"@commitlint/config-angular": "^8.3.4",
|
"@commitlint/config-angular": "^9.1.1",
|
||||||
"@types/node": "^10.12.24",
|
"@types/node": "^12.12.6",
|
||||||
"@types/ws": "^7.2.1",
|
"@types/ws": "^7.2.6",
|
||||||
"cross-env": "^7.0.2",
|
"cross-env": "^7.0.2",
|
||||||
"discord.js-docgen": "discordjs/docgen",
|
"discord.js-docgen": "discordjs/docgen",
|
||||||
"dtslint": "^3.0.0",
|
"dtslint": "^3.6.14",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^7.6.0",
|
||||||
"eslint-config-prettier": "^6.10.0",
|
"eslint-config-prettier": "^6.11.0",
|
||||||
"eslint-plugin-import": "^2.20.1",
|
"eslint-plugin-import": "^2.22.0",
|
||||||
"eslint-plugin-prettier": "^3.1.2",
|
"eslint-plugin-prettier": "^3.1.4",
|
||||||
"husky": "^4.2.3",
|
"husky": "^4.2.5",
|
||||||
"jest": "^25.1.0",
|
"jest": "^26.4.0",
|
||||||
"json-filter-loader": "^1.0.0",
|
"json-filter-loader": "^1.0.0",
|
||||||
"lint-staged": "^10.0.8",
|
"lint-staged": "^10.2.11",
|
||||||
"prettier": "^1.19.1",
|
"prettier": "^2.0.5",
|
||||||
"terser-webpack-plugin": "^1.2.2",
|
"terser-webpack-plugin": "^4.1.0",
|
||||||
"tslint": "^6.0.0",
|
"tslint": "^6.1.3",
|
||||||
"typescript": "^3.8.2",
|
"typescript": "^3.9.7",
|
||||||
"webpack": "^4.41.6",
|
"webpack": "^4.44.1",
|
||||||
"webpack-cli": "^3.3.11"
|
"webpack-cli": "^3.3.12"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.0.0"
|
"node": ">=12.0.0"
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.js": "eslint --fix",
|
"*.js": "eslint --fix",
|
||||||
"*.ts": "prettier --write --single-quote --print-width 120 --trailing-comma all --end-of-line lf"
|
"*.ts": "prettier --write --single-quote --print-width 120 --trailing-comma all --end-of-line lf --arrow-parens avoid"
|
||||||
},
|
},
|
||||||
"commitlint": {
|
"commitlint": {
|
||||||
"extends": [
|
"extends": [
|
||||||
|
|||||||
@@ -18,9 +18,7 @@ const BeforeReadyWhitelist = [
|
|||||||
WSEvents.GUILD_MEMBER_REMOVE,
|
WSEvents.GUILD_MEMBER_REMOVE,
|
||||||
];
|
];
|
||||||
|
|
||||||
const UNRECOVERABLE_CLOSE_CODES = Object.keys(WSCodes)
|
const UNRECOVERABLE_CLOSE_CODES = Object.keys(WSCodes).slice(1).map(Number);
|
||||||
.slice(1)
|
|
||||||
.map(Number);
|
|
||||||
const UNRESUMABLE_CLOSE_CODES = [1000, 4006, 4007];
|
const UNRESUMABLE_CLOSE_CODES = [1000, 4006, 4007];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -121,10 +121,7 @@ class MessageManager extends BaseManager {
|
|||||||
async delete(message, reason) {
|
async delete(message, reason) {
|
||||||
message = this.resolveID(message);
|
message = this.resolveID(message);
|
||||||
if (message) {
|
if (message) {
|
||||||
await this.client.api
|
await this.client.api.channels(this.channel.id).messages(message).delete({ reason });
|
||||||
.channels(this.channel.id)
|
|
||||||
.messages(message)
|
|
||||||
.delete({ reason });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,10 +74,7 @@ class GuildEmoji extends BaseGuildEmoji {
|
|||||||
throw new Error('MISSING_MANAGE_EMOJIS_PERMISSION', this.guild);
|
throw new Error('MISSING_MANAGE_EMOJIS_PERMISSION', this.guild);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const data = await this.client.api
|
const data = await this.client.api.guilds(this.guild.id).emojis(this.id).get();
|
||||||
.guilds(this.guild.id)
|
|
||||||
.emojis(this.id)
|
|
||||||
.get();
|
|
||||||
this._patch(data);
|
this._patch(data);
|
||||||
return this.author;
|
return this.author;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -330,10 +330,7 @@ class TextBasedChannel {
|
|||||||
}
|
}
|
||||||
if (messageIDs.length === 0) return new Collection();
|
if (messageIDs.length === 0) return new Collection();
|
||||||
if (messageIDs.length === 1) {
|
if (messageIDs.length === 1) {
|
||||||
await this.client.api
|
await this.client.api.channels(this.id).messages(messageIDs[0]).delete();
|
||||||
.channels(this.id)
|
|
||||||
.messages(messageIDs[0])
|
|
||||||
.delete();
|
|
||||||
const message = this.client.actions.MessageDelete.getMessage(
|
const message = this.client.actions.MessageDelete.getMessage(
|
||||||
{
|
{
|
||||||
message_id: messageIDs[0],
|
message_id: messageIDs[0],
|
||||||
|
|||||||
@@ -64,9 +64,7 @@ class SnowflakeUtil {
|
|||||||
* @returns {DeconstructedSnowflake} Deconstructed snowflake
|
* @returns {DeconstructedSnowflake} Deconstructed snowflake
|
||||||
*/
|
*/
|
||||||
static deconstruct(snowflake) {
|
static deconstruct(snowflake) {
|
||||||
const BINARY = Util.idToBinary(snowflake)
|
const BINARY = Util.idToBinary(snowflake).toString(2).padStart(64, '0');
|
||||||
.toString(2)
|
|
||||||
.padStart(64, '0');
|
|
||||||
const res = {
|
const res = {
|
||||||
timestamp: parseInt(BINARY.substring(0, 42), 2) + EPOCH,
|
timestamp: parseInt(BINARY.substring(0, 42), 2) + EPOCH,
|
||||||
workerID: parseInt(BINARY.substring(42, 47), 2),
|
workerID: parseInt(BINARY.substring(42, 47), 2),
|
||||||
|
|||||||
28
typings/index.d.ts
vendored
28
typings/index.d.ts
vendored
@@ -699,7 +699,10 @@ declare module 'discord.js' {
|
|||||||
): Promise<Guild>;
|
): Promise<Guild>;
|
||||||
public setDiscoverySplash(discoverySplash: Base64Resolvable | null, reason?: string): Promise<Guild>;
|
public setDiscoverySplash(discoverySplash: Base64Resolvable | null, reason?: string): Promise<Guild>;
|
||||||
public setEmbed(embed: GuildWidgetData, reason?: string): Promise<Guild>;
|
public setEmbed(embed: GuildWidgetData, reason?: string): Promise<Guild>;
|
||||||
public setExplicitContentFilter(explicitContentFilter: ExplicitContentFilterLevel | number, reason?: string): Promise<Guild>;
|
public setExplicitContentFilter(
|
||||||
|
explicitContentFilter: ExplicitContentFilterLevel | number,
|
||||||
|
reason?: string,
|
||||||
|
): Promise<Guild>;
|
||||||
public setIcon(icon: Base64Resolvable | null, reason?: string): Promise<Guild>;
|
public setIcon(icon: Base64Resolvable | null, reason?: string): Promise<Guild>;
|
||||||
public setName(name: string, reason?: string): Promise<Guild>;
|
public setName(name: string, reason?: string): Promise<Guild>;
|
||||||
public setOwner(owner: GuildMemberResolvable, reason?: string): Promise<Guild>;
|
public setOwner(owner: GuildMemberResolvable, reason?: string): Promise<Guild>;
|
||||||
@@ -2928,7 +2931,17 @@ declare module 'discord.js' {
|
|||||||
interface PartialGuildMember
|
interface PartialGuildMember
|
||||||
extends Partialize<
|
extends Partialize<
|
||||||
GuildMember,
|
GuildMember,
|
||||||
'bannable' | 'displayColor' | 'displayHexColor' | 'displayName' | 'guild' | 'kickable' | 'permissions' | 'roles' | 'manageable' | 'presence' | 'voice'
|
| 'bannable'
|
||||||
|
| 'displayColor'
|
||||||
|
| 'displayHexColor'
|
||||||
|
| 'displayName'
|
||||||
|
| 'guild'
|
||||||
|
| 'kickable'
|
||||||
|
| 'permissions'
|
||||||
|
| 'roles'
|
||||||
|
| 'manageable'
|
||||||
|
| 'presence'
|
||||||
|
| 'voice'
|
||||||
> {
|
> {
|
||||||
readonly bannable: boolean;
|
readonly bannable: boolean;
|
||||||
readonly displayColor: number;
|
readonly displayColor: number;
|
||||||
@@ -2948,7 +2961,16 @@ declare module 'discord.js' {
|
|||||||
interface PartialMessage
|
interface PartialMessage
|
||||||
extends Partialize<
|
extends Partialize<
|
||||||
Message,
|
Message,
|
||||||
'attachments' | 'channel' | 'deletable' | 'editable' | 'mentions' | 'pinnable' | 'url' | 'flags' | 'edits' | 'embeds'
|
| 'attachments'
|
||||||
|
| 'channel'
|
||||||
|
| 'deletable'
|
||||||
|
| 'editable'
|
||||||
|
| 'mentions'
|
||||||
|
| 'pinnable'
|
||||||
|
| 'url'
|
||||||
|
| 'flags'
|
||||||
|
| 'edits'
|
||||||
|
| 'embeds'
|
||||||
> {
|
> {
|
||||||
attachments: Message['attachments'];
|
attachments: Message['attachments'];
|
||||||
channel: Message['channel'];
|
channel: Message['channel'];
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const TerserJSPlugin = require('terser-webpack-plugin');
|
const TerserJSPlugin = require('terser-webpack-plugin');
|
||||||
const webpack = require('webpack');
|
|
||||||
const version = require('./package.json').version;
|
const version = require('./package.json').version;
|
||||||
|
|
||||||
const prod = process.env.NODE_ENV === 'production';
|
const prod = process.env.NODE_ENV === 'production';
|
||||||
@@ -47,17 +46,17 @@ module.exports = {
|
|||||||
zlib: 'empty',
|
zlib: 'empty',
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
|
minimize: true,
|
||||||
minimizer: [
|
minimizer: [
|
||||||
new TerserJSPlugin({
|
new TerserJSPlugin({
|
||||||
cache: false,
|
cache: false,
|
||||||
terserOptions: {
|
terserOptions: {
|
||||||
mangle: { keep_classnames: true },
|
mangle: { keep_classnames: true, keep_fnames: true },
|
||||||
compress: { keep_classnames: true },
|
|
||||||
keep_classnames: true,
|
keep_classnames: true,
|
||||||
|
keep_fnames: true,
|
||||||
output: { comments: false },
|
output: { comments: false },
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [new webpack.optimize.ModuleConcatenationPlugin()],
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user