Skip to content

Commit

Permalink
[Fix] Ensure that options have correct types
Browse files Browse the repository at this point in the history
this is for the js user who use Environment variables and don't check for types themself
  • Loading branch information
DevYukine committed Jan 27, 2021
1 parent 4a1b78d commit 8e8e65a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Sharding/ShardingManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ export class ShardingManager extends EventEmitter {

public constructor(public path: string, options: SharderOptions) {
super();
this.clusterCount = options.clusterCount ?? cpus().length;
this.guildsPerShard = options.guildsPerShard ?? 1000;
this.clusterCount = Number(options.clusterCount ?? cpus().length);
this.guildsPerShard = Number(options.guildsPerShard ?? 1000);
this.clientOptions = options.clientOptions ?? {};
this.development = options.development ?? false;
this.shardCount = options.shardCount ?? 'auto';
this.shardCount = Number.isNaN(options.shardCount) ? 'auto' : Number(options.shardCount);
this.client = options.client ?? Client;
this.respawn = options.respawn ?? true;
this.ipcSocket = options.ipcSocket ?? 9999;
this.retry = options.retry ?? true;
this.timeout = options.timeout ?? 30000;
this.timeout = Number(options.timeout ?? 30000);
this.token = options.token;
this.nodeArgs = options.nodeArgs;
this.ipc = new MasterIPC(this);
Expand Down

0 comments on commit 8e8e65a

Please sign in to comment.