diff --git a/src/client/Client.js b/src/client/Client.js index 4b335e88a..77f0682c2 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -70,11 +70,10 @@ class Client extends BaseClient { this.voice = !browser ? new ClientVoiceManager(this) : null; /** - * The shard helpers for the client - * (only if the process was spawned as a child, such as from a {@link ShardingManager}) + * Shard helpers for the client (only if the process was spawned from a {@link ShardingManager}) * @type {?ShardClientUtil} */ - this.shard = !browser && process.send ? ShardClientUtil.singleton(this) : null; + this.shard = !browser && process.env.SHARDING_MANAGER ? ShardClientUtil.singleton(this) : null; /** * All of the {@link User} objects that have been cached at any point, mapped by their IDs diff --git a/src/sharding/Shard.js b/src/sharding/Shard.js index 0e44f91a2..98bafff2e 100644 --- a/src/sharding/Shard.js +++ b/src/sharding/Shard.js @@ -42,6 +42,7 @@ class Shard extends EventEmitter { * @type {Object} */ this.env = Object.assign({}, process.env, { + SHARDING_MANAGER: true, SHARD_ID: this.id, SHARD_COUNT: this.manager.totalShards, CLIENT_TOKEN: this.manager.token,