mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
Fixed DataStore, deprecation leftovers and a bit of Event Constants (#1841)
* Fixed leftover fetchThing and removed unused methods/error messages * Added resume event constant and used event constants wherever possible * Replaced mentions of removed method name with their new name. * Fixed typo: resume -> resumed
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const Util = require('../util/Util');
|
||||
const Constants = require('../util/Constants');
|
||||
const { Error } = require('../errors');
|
||||
|
||||
/**
|
||||
@@ -123,7 +124,7 @@ class ShardClientUtil {
|
||||
_respond(type, message) {
|
||||
this.send(message).catch(err => {
|
||||
err.message = `Error when sending ${type} response to master process: ${err.message}`;
|
||||
this.client.emit('error', err);
|
||||
this.client.emit(Constants.Events.ERROR, err);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -136,7 +137,8 @@ class ShardClientUtil {
|
||||
if (!this._singleton) {
|
||||
this._singleton = new this(client);
|
||||
} else {
|
||||
client.emit('warn', 'Multiple clients created in child process; only the first will handle sharding helpers.');
|
||||
client.emit(Constants.Events.WARN,
|
||||
'Multiple clients created in child process; only the first will handle sharding helpers.');
|
||||
}
|
||||
return this._singleton;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user