Closed tiritto closed 4 years ago
Here's a question. Why are you using the ws options? For compression, all you have to do is npm i zlib-sync
(or your preferred package manager)..
I don't actually know what the compress: true
does, I'll have to shoot an eye at it
Documentation doesn't say anything about negative effects nor discourages the use of it, so I feel like it's only natural to enable compression whenever possible for any network-related processes. It's casually listed under ClientOptions
so I don't see anything wrong with customizing your bot configuration. Moreover, this setting was not causing any troubles for most of the time. I just noticed it's no longer working right on the master branch.
Also, according to documentation:
Whether to compress data sent on the connection (defaults to false for browsers)
The defaults to false for browsers part makes it sound like it's actually more encouraged to turn it on when not dealing with browser implementation.
Here's your answer, asked in the Discord API server. If you want compression, just install zlib-sync.
Well, that explains a lot. Thanks for your time! Can we change this issue from bug report to suggestion? I guess it would be a good idea to leave a notice in DiscordJS documentation for other people.
Please describe the problem you are having in as much detail as possible: The bot seems to be unable to receive or emit events, becoming unresponsive for anything. However, the connection and verification are handled correctly since bot itself DOES login and shows up online on the member list. Moreover, if I regenerate its token while the bot is running, the bot is instantly throwing out access denied errors as soon as I regenerate the token, meaning that it apparently does upkeep the connection with Discord itself correctly.
Include a reproducible code sample here, if possible:
Hello there!
will not be displayed as long as'ws': { compress: true }
is in use.Further details:
discord.js version: Master (commit: a36f386)
Node.js version: 12.15.0
Operating system: Debian GNU/Linux 9.12
Priority: Low. Disabling compression fixes the issue right away.
[x] I have also tested the issue on latest master, commit hash: a36f386