mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
fix(Shard): extend EventEmitter to be able to emit events (#2112)
This commit is contained in:
committed by
Schuyler Cebulskie
parent
196cf7652e
commit
6fa4fc532c
@@ -1,4 +1,5 @@
|
|||||||
const childProcess = require('child_process');
|
const childProcess = require('child_process');
|
||||||
|
const EventEmitter = require('events');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const Util = require('../util/Util');
|
const Util = require('../util/Util');
|
||||||
const { Error } = require('../errors');
|
const { Error } = require('../errors');
|
||||||
@@ -6,13 +7,14 @@ const { Error } = require('../errors');
|
|||||||
/**
|
/**
|
||||||
* Represents a Shard spawned by the ShardingManager.
|
* Represents a Shard spawned by the ShardingManager.
|
||||||
*/
|
*/
|
||||||
class Shard {
|
class Shard extends EventEmitter {
|
||||||
/**
|
/**
|
||||||
* @param {ShardingManager} manager Manager that is spawning this shard
|
* @param {ShardingManager} manager Manager that is spawning this shard
|
||||||
* @param {number} id ID of this shard
|
* @param {number} id ID of this shard
|
||||||
* @param {string[]} [args=[]] Command line arguments to pass to the script
|
* @param {string[]} [args=[]] Command line arguments to pass to the script
|
||||||
*/
|
*/
|
||||||
constructor(manager, id, args = []) {
|
constructor(manager, id, args = []) {
|
||||||
|
super();
|
||||||
/**
|
/**
|
||||||
* Manager that created the shard
|
* Manager that created the shard
|
||||||
* @type {ShardingManager}
|
* @type {ShardingManager}
|
||||||
|
|||||||
Reference in New Issue
Block a user