mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 12:35:53 +00:00
fix unpack weird issues (#1729)
This commit is contained in:
parent
a46f606170
commit
0acb0ac5dc
1 changed files with 1 additions and 0 deletions
|
|
@ -166,6 +166,7 @@ class WebSocketConnection extends EventEmitter {
|
|||
* @returns {Object}
|
||||
*/
|
||||
unpack(data) {
|
||||
if (Array.isArray(data)) data = Buffer.concat(data);
|
||||
if (data instanceof ArrayBuffer) data = Buffer.from(new Uint8Array(data));
|
||||
|
||||
if (erlpack && typeof data !== 'string') return erlpack.unpack(data);
|
||||
|
|
|
|||
Loading…
Reference in a new issue