mirror of
https://github.com/danbulant/discord.js
synced 2026-07-08 04:31:05 +00:00
Emergency bug fix
Stopped the client from assuming all errors were 429 errors
This commit is contained in:
parent
d8ac7e97a1
commit
d93990822e
3 changed files with 1 additions and 3 deletions
|
|
@ -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 &&
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue