Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes app when hitting Discord rate limit #1181

Closed
ak505188 opened this issue Feb 11, 2017 · 7 comments
Closed

Crashes app when hitting Discord rate limit #1181

ak505188 opened this issue Feb 11, 2017 · 7 comments

Comments

@ak505188
Copy link

ak505188 commented Feb 11, 2017

Get this error when I get a 429 from Discord.
Running in a Docker container on a Raspberry Pi 3. Node version is 7.4.0.

/usr/src/app/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:79
            this.restManager.client.setTimeout(() => {
                                    ^
TypeError: this.restManager.client.setTimeout is not a function
    at item.request.gen.end (/usr/src/app/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:79:37)
    at Request.callback (/usr/src/app/node_modules/superagent/lib/node/index.js:619:12)
    at /usr/src/app/node_modules/superagent/lib/node/index.js:795:18
    at Stream.<anonymous> (/usr/src/app/node_modules/superagent/lib/node/parsers/json.js:16:7)
    at emitNone (events.js:86:13)
    at Stream.emit (events.js:185:7)
    at Unzip.<anonymous> (/usr/src/app/node_modules/superagent/lib/node/utils.js:112:12)
    at emitNone (events.js:91:20)
    at Unzip.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

This was on the latest release. Hit the same bug on the latest commit as well. Here's the stack trace.

/usr/src/app/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:68
            this.restManager.client.setTimeout(
                                    ^

TypeError: this.restManager.client.setTimeout is not a function
    at item.request.gen.end (/usr/src/app/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:68:37)
    at Request.callback (/usr/src/app/node_modules/superagent/lib/node/index.js:652:14)
    at /usr/src/app/node_modules/superagent/lib/node/index.js:866:18
    at Stream.<anonymous> (/usr/src/app/node_modules/superagent/lib/node/parsers/json.js:16:7)
    at emitNone (events.js:86:13)
    at Stream.emit (events.js:185:7)
    at Unzip.<anonymous> (/usr/src/app/node_modules/superagent/lib/node/unzip.js:53:12)
    at emitNone (events.js:91:20)
    at Unzip.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
@Gawdl3y
Copy link
Member

Gawdl3y commented Feb 15, 2017

No idea how this is happening.

@mrkishi
Copy link

mrkishi commented Feb 18, 2017

I've experienced the same. It happens when using WebhookClient: it initializes a RESTManager with a reference to itself, but it isn't an actual Client and as such doesn't have a setTimeout.

@devsnek
Copy link
Member

devsnek commented Feb 19, 2017

I will fix this on Monday unless someone beats me to it, thanks for reporting this :)

@mrkishi
Copy link

mrkishi commented Feb 22, 2017

Hey @GusCaplan and @Gawdl3y, thank you for the fix.

Quick question: when could we expect this to be published to npm? Is it maybe a "cherry-pick as a patch version bump" case?

@devsnek
Copy link
Member

devsnek commented Feb 22, 2017

you can just do npm i hydrabolt/discord.js

@mrkishi
Copy link

mrkishi commented Feb 22, 2017

But then I'd have to keep track of every breaking change in master -- or are there none?

@devsnek
Copy link
Member

devsnek commented Feb 22, 2017

not at the moment, we are gearing for 11.1.0 release right now.

devsnek added a commit to devsnek/discord.js that referenced this issue May 14, 2017
… and clean up docs (discordjs#1204)

* fix up 1181

* Clean up documentation

* Update WebhookClient.js
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants