mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 17:21:31 +00:00
fix(Shard): extend EventEmitter to be able to emit events (#2112)
This commit is contained in:
parent
196cf7652e
commit
6fa4fc532c
1 changed files with 3 additions and 1 deletions
|
|
@ -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}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue