mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
Emergency bug fix
Stopped the client from assuming all errors were 429 errors
This commit is contained in:
@@ -132,7 +132,6 @@ var InternalClient = (function () {
|
|||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
ret.end(function (error, data) {
|
ret.end(function (error, data) {
|
||||||
if (error) {
|
if (error) {
|
||||||
error.response.error.status = 429;
|
|
||||||
if (!_this.client.options.rate_limit_as_error && error.response && error.response.error && error.response.error.status && error.response.error.status === 429) {
|
if (!_this.client.options.rate_limit_as_error && error.response && error.response.error && error.response.error.status && error.response.error.status === 429) {
|
||||||
|
|
||||||
if (data.headers["retry-after"] || data.headers["Retry-After"]) {
|
if (data.headers["retry-after"] || data.headers["Retry-After"]) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "discord.js",
|
"name": "discord.js",
|
||||||
"version": "5.1.0",
|
"version": "5.2.0",
|
||||||
"description": "A way to interface with the Discord API",
|
"description": "A way to interface with the Discord API",
|
||||||
"main": "./entrypoint.js",
|
"main": "./entrypoint.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ export default class InternalClient {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
ret.end((error, data) => {
|
ret.end((error, data) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
error.response.error.status = 429;
|
|
||||||
if (!this.client.options.rate_limit_as_error &&
|
if (!this.client.options.rate_limit_as_error &&
|
||||||
error.response &&
|
error.response &&
|
||||||
error.response.error &&
|
error.response.error &&
|
||||||
|
|||||||
Reference in New Issue
Block a user