mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix: ws package.json path (#8720)
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import process from 'node:process';
|
||||
import { Collection } from '@discordjs/collection';
|
||||
import { lazy } from '@discordjs/util';
|
||||
import { APIVersion, GatewayOpcodes } from 'discord-api-types/v10';
|
||||
import { version } from '../../package.json';
|
||||
import type { OptionalWebSocketManagerOptions, SessionInfo } from '../ws/WebSocketManager.js';
|
||||
|
||||
/**
|
||||
@@ -20,10 +19,7 @@ export enum CompressionMethod {
|
||||
ZlibStream = 'zlib-stream',
|
||||
}
|
||||
|
||||
const packageJson = readFileSync(join(__dirname, '..', '..', 'package.json'), 'utf8');
|
||||
const Package = JSON.parse(packageJson);
|
||||
|
||||
export const DefaultDeviceProperty = `@discordjs/ws ${Package.version}`;
|
||||
export const DefaultDeviceProperty = `@discordjs/ws ${version}`;
|
||||
|
||||
const getDefaultSessionStore = lazy(() => new Collection<number, SessionInfo | null>());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user