mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-04 22:16:08 +00:00
fix: gateway manager options
This commit is contained in:
parent
e535108956
commit
2e9fb74c16
@ -1,12 +1,10 @@
|
|||||||
export const GatewayManagerDefaultOptions = {
|
export const GatewayManagerDefaultOptions = {
|
||||||
compress: false,
|
|
||||||
intents: 0,
|
intents: 0,
|
||||||
properties: {
|
properties: {
|
||||||
os: process.platform,
|
os: process.platform,
|
||||||
browser: 'Biscuit',
|
browser: 'Biscuit',
|
||||||
device: 'Biscuit'
|
device: 'Biscuit'
|
||||||
},
|
},
|
||||||
url: 'wss://gateway.discord.gg',
|
|
||||||
version: 10,
|
version: 10,
|
||||||
totalShards: 1,
|
totalShards: 1,
|
||||||
lastShardId: 0,
|
lastShardId: 0,
|
||||||
|
@ -13,12 +13,13 @@ export class GatewayManager {
|
|||||||
cache: Collection<string, GatewayMemberRequest> | null = null;
|
cache: Collection<string, GatewayMemberRequest> | null = null;
|
||||||
options: Required<CreateGatewayManagerOptions>;
|
options: Required<CreateGatewayManagerOptions>;
|
||||||
logger: Logger;
|
logger: Logger;
|
||||||
constructor(options: CreateGatewayManagerOptions) {
|
constructor({ connection, ...options }: CreateGatewayManagerOptions) {
|
||||||
this.options = Options<Required<CreateGatewayManagerOptions>>(GatewayManagerDefaultOptions, {
|
this.options = Options<Required<CreateGatewayManagerOptions>>(GatewayManagerDefaultOptions, {
|
||||||
...options,
|
...options,
|
||||||
lastShardId:
|
lastShardId: options.lastShardId ?? (options.totalShards ? options.totalShards - 1 : connection ? connection.shards - 1 : 0)
|
||||||
options.lastShardId ?? (options.totalShards ? options.totalShards - 1 : options.connection ? options.connection.shards - 1 : 0)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.options.connection = connection;
|
||||||
if (this.options.cache) this.cache = new Collection();
|
if (this.options.cache) this.cache = new Collection();
|
||||||
this.logger = new Logger({
|
this.logger = new Logger({
|
||||||
name: '[GatewayManager]',
|
name: '[GatewayManager]',
|
||||||
@ -114,7 +115,7 @@ export class GatewayManager {
|
|||||||
id: shardId,
|
id: shardId,
|
||||||
connection: {
|
connection: {
|
||||||
intents: this.options.intents,
|
intents: this.options.intents,
|
||||||
url: this.options.url,
|
url: this.options.connection.url,
|
||||||
version: this.options.version,
|
version: this.options.version,
|
||||||
token: this.options.token,
|
token: this.options.token,
|
||||||
totalShards: this.options.totalShards,
|
totalShards: this.options.totalShards,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user