mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
parent
6e616edc69
commit
4fc461c2f9
1 changed files with 13 additions and 8 deletions
|
|
@ -2,19 +2,24 @@
|
|||
|
||||
const EventEmitter = require('events');
|
||||
const WebSocket = require('../../WebSocket');
|
||||
const { Status, Events, ShardEvents, OPCodes, WSEvents } = require('../../util/Constants');
|
||||
const { browser, Status, Events, ShardEvents, OPCodes, WSEvents } = require('../../util/Constants');
|
||||
|
||||
let zstd;
|
||||
let zlib;
|
||||
|
||||
try {
|
||||
zstd = require('zucc');
|
||||
} catch (e) {
|
||||
if (browser) {
|
||||
zlib = require('pako');
|
||||
} else {
|
||||
try {
|
||||
zlib = require('zlib-sync');
|
||||
if (!zlib.Inflate) zlib = require('pako');
|
||||
} catch (err) {
|
||||
zlib = require('pako');
|
||||
zstd = require('zucc');
|
||||
if (!zstd.DecompressStream) zstd = null;
|
||||
} catch (e) {
|
||||
try {
|
||||
zlib = require('zlib-sync');
|
||||
if (!zlib.Inflate) zlib = require('pako');
|
||||
} catch (err) {
|
||||
zlib = require('pako');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue