mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
docs(sharding): ShardingManager#createShard doesn't spawn the s… (#3875)
* Fixed createShard() to show an example! * docs(ShardingManager): clarify createdShard docs * docs(Shard): clarify manager parameter * docs(ShardingManager): use an info tag for createShard's param Co-Authored-By: Sugden <28943913+NotSugden@users.noreply.github.com> Co-authored-by: SpaceEEC <spaceeec@yahoo.com> Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
@@ -15,7 +15,7 @@ let Worker = null;
|
|||||||
*/
|
*/
|
||||||
class Shard extends EventEmitter {
|
class Shard extends EventEmitter {
|
||||||
/**
|
/**
|
||||||
* @param {ShardingManager} manager Manager that is spawning this shard
|
* @param {ShardingManager} manager Manager that is creating this shard
|
||||||
* @param {number} id ID of this shard
|
* @param {number} id ID of this shard
|
||||||
*/
|
*/
|
||||||
constructor(manager, id) {
|
constructor(manager, id) {
|
||||||
|
|||||||
@@ -143,10 +143,11 @@ class ShardingManager extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Spawns a single shard.
|
* Creates a single shard.
|
||||||
* @param {number} [id=this.shards.size] ID of the shard to spawn -
|
* <warn>Using this method is usually not necessary if you use the spawn method.</warn>
|
||||||
* **This is usually not necessary to manually specify.**
|
* @param {number} [id=this.shards.size] ID of the shard to create
|
||||||
* @returns {Shard}
|
* <info>This is usually not necessary to manually specify.</info>
|
||||||
|
* @returns {Shard} Note that the created shard needs to be explicitly spawned using its spawn method.
|
||||||
*/
|
*/
|
||||||
createShard(id = this.shards.size) {
|
createShard(id = this.shards.size) {
|
||||||
const shard = new Shard(this, id);
|
const shard = new Shard(this, id);
|
||||||
|
|||||||
Reference in New Issue
Block a user