mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Add client shard eval/client property fetching, and improve existing shard stuff
This commit is contained in:
@@ -10,7 +10,7 @@ const WebSocketManager = require('./websocket/WebSocketManager');
|
||||
const ActionsManager = require('./actions/ActionsManager');
|
||||
const Collection = require('../util/Collection');
|
||||
const Presence = require('../structures/Presence').Presence;
|
||||
const ShardUtil = require('../sharding/ShardUtil');
|
||||
const ShardClientUtil = require('../sharding/ShardClientUtil');
|
||||
|
||||
/**
|
||||
* The starting point for making a Discord Bot.
|
||||
@@ -90,7 +90,7 @@ class Client extends EventEmitter {
|
||||
* The shard helpers for the client (only if the process was spawned as a child, such as from a ShardingManager)
|
||||
* @type {?ShardUtil}
|
||||
*/
|
||||
this.shard = process.send ? ShardUtil.singleton(this) : null;
|
||||
this.shard = process.send ? ShardClientUtil.singleton(this) : null;
|
||||
if (this.shard) process.on('message', this.shard._handleMessage.bind(this.shard));
|
||||
|
||||
/**
|
||||
@@ -339,6 +339,10 @@ class Client extends EventEmitter {
|
||||
}
|
||||
this.presences.set(id, new Presence(presence));
|
||||
}
|
||||
|
||||
_eval(script) {
|
||||
return eval(script);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Client;
|
||||
|
||||
Reference in New Issue
Block a user