@@ -2,6 +2,7 @@ import process from 'node:process';
2
2
import { Collection } from '@discordjs/collection' ;
3
3
import { lazy } from '@discordjs/util' ;
4
4
import { APIVersion , GatewayOpcodes } from 'discord-api-types/v10' ;
5
+ import * as ZlibSync from 'zlib-sync' ;
5
6
import { SimpleShardingStrategy } from '../strategies/sharding/SimpleShardingStrategy.js' ;
6
7
import { SimpleIdentifyThrottler } from '../throttling/SimpleIdentifyThrottler.js' ;
7
8
import type { SessionInfo , OptionalWebSocketManagerOptions , WebSocketManager } from '../ws/WebSocketManager.js' ;
@@ -31,6 +32,17 @@ export const CompressionParameterMap = {
31
32
[ CompressionMethod . ZlibSync ] : 'zlib-stream' ,
32
33
} as const satisfies Record < CompressionMethod , string > ;
33
34
35
+ export const ZlibErrorCodes = {
36
+ [ ZlibSync . Z_NEED_DICT ] : 'Z_NEED_DICT' ,
37
+ [ ZlibSync . Z_STREAM_END ] : 'Z_STREAM_END' ,
38
+ [ ZlibSync . Z_ERRNO ] : 'Z_ERRNO' ,
39
+ [ ZlibSync . Z_STREAM_ERROR ] : 'Z_STREAM_ERROR' ,
40
+ [ ZlibSync . Z_DATA_ERROR ] : 'Z_DATA_ERROR' ,
41
+ [ ZlibSync . Z_MEM_ERROR ] : 'Z_MEM_ERROR' ,
42
+ [ ZlibSync . Z_BUF_ERROR ] : 'Z_BUF_ERROR' ,
43
+ [ ZlibSync . Z_VERSION_ERROR ] : 'Z_VERSION_ERROR' ,
44
+ } as const satisfies Record < number , string > ;
45
+
34
46
/**
35
47
* Default options used by the manager
36
48
*/
0 commit comments