mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +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 EventEmitter = require('events');
|
||||
const path = require('path');
|
||||
const Util = require('../util/Util');
|
||||
const { Error } = require('../errors');
|
||||
|
|
@ -6,13 +7,14 @@ const { Error } = require('../errors');
|
|||
/**
|
||||
* Represents a Shard spawned by the ShardingManager.
|
||||
*/
|
||||
class Shard {
|
||||
class Shard extends EventEmitter {
|
||||
/**
|
||||
* @param {ShardingManager} manager Manager that is spawning this shard
|
||||
* @param {number} id ID of this shard
|
||||
* @param {string[]} [args=[]] Command line arguments to pass to the script
|
||||
*/
|
||||
constructor(manager, id, args = []) {
|
||||
super();
|
||||
/**
|
||||
* Manager that created the shard
|
||||
* @type {ShardingManager}
|
||||
|
|
|
|||
Loading…
Reference in a new issue