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 = {
|
||||
compress: false,
|
||||
intents: 0,
|
||||
properties: {
|
||||
os: process.platform,
|
||||
browser: 'Biscuit',
|
||||
device: 'Biscuit'
|
||||
},
|
||||
url: 'wss://gateway.discord.gg',
|
||||
version: 10,
|
||||
totalShards: 1,
|
||||
lastShardId: 0,
|
||||
|
@ -13,12 +13,13 @@ export class GatewayManager {
|
||||
cache: Collection<string, GatewayMemberRequest> | null = null;
|
||||
options: Required<CreateGatewayManagerOptions>;
|
||||
logger: Logger;
|
||||
constructor(options: CreateGatewayManagerOptions) {
|
||||
constructor({ connection, ...options }: CreateGatewayManagerOptions) {
|
||||
this.options = Options<Required<CreateGatewayManagerOptions>>(GatewayManagerDefaultOptions, {
|
||||
...options,
|
||||
lastShardId:
|
||||
options.lastShardId ?? (options.totalShards ? options.totalShards - 1 : options.connection ? options.connection.shards - 1 : 0)
|
||||
lastShardId: options.lastShardId ?? (options.totalShards ? options.totalShards - 1 : connection ? connection.shards - 1 : 0)
|
||||
});
|
||||
|
||||
this.options.connection = connection;
|
||||
if (this.options.cache) this.cache = new Collection();
|
||||
this.logger = new Logger({
|
||||
name: '[GatewayManager]',
|
||||
@ -114,7 +115,7 @@ export class GatewayManager {
|
||||
id: shardId,
|
||||
connection: {
|
||||
intents: this.options.intents,
|
||||
url: this.options.url,
|
||||
url: this.options.connection.url,
|
||||
version: this.options.version,
|
||||
token: this.options.token,
|
||||
totalShards: this.options.totalShards,
|
||||
|
Loading…
x
Reference in New Issue
Block a user