mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
Remove cached events
This commit is contained in:
@@ -22,14 +22,6 @@ class ClientDataManager {
|
|||||||
const already = this.client.guilds.has(data.id);
|
const already = this.client.guilds.has(data.id);
|
||||||
const guild = new Guild(this.client, data);
|
const guild = new Guild(this.client, data);
|
||||||
this.client.guilds.set(guild.id, guild);
|
this.client.guilds.set(guild.id, guild);
|
||||||
if (this.client.listenerCount(Constants.Events.GUILD_CACHED)) {
|
|
||||||
/**
|
|
||||||
* Emitted whenever a guild is added to the cache
|
|
||||||
* @event Client#guildCached
|
|
||||||
* @param {Guild} guild The cached guild
|
|
||||||
*/
|
|
||||||
this.client.emit(Constants.Events.GUILD_CACHED, guild);
|
|
||||||
}
|
|
||||||
if (this.pastReady && !already) {
|
if (this.pastReady && !already) {
|
||||||
/**
|
/**
|
||||||
* Emitted whenever the client joins a guild.
|
* Emitted whenever the client joins a guild.
|
||||||
@@ -74,15 +66,6 @@ class ClientDataManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (channel) {
|
if (channel) {
|
||||||
if (this.client.listenerCount(Constants.Events.CHANNEL_CACHED)) {
|
|
||||||
/**
|
|
||||||
* Emitted whenever a channel is added to the cache
|
|
||||||
* @event Client#channelCached
|
|
||||||
* @param {Channel} channel The cached channel
|
|
||||||
*/
|
|
||||||
this.client.emit(Constants.Events.CHANNEL_CACHED, channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.pastReady && !already) this.client.emit(Constants.Events.CHANNEL_CREATE, channel);
|
if (this.pastReady && !already) this.client.emit(Constants.Events.CHANNEL_CREATE, channel);
|
||||||
this.client.channels.set(channel.id, channel);
|
this.client.channels.set(channel.id, channel);
|
||||||
return channel;
|
return channel;
|
||||||
|
|||||||
@@ -197,7 +197,6 @@ exports.VoiceOPCodes = {
|
|||||||
|
|
||||||
exports.Events = {
|
exports.Events = {
|
||||||
READY: 'ready',
|
READY: 'ready',
|
||||||
GUILD_CACHED: 'guildCached',
|
|
||||||
GUILD_CREATE: 'guildCreate',
|
GUILD_CREATE: 'guildCreate',
|
||||||
GUILD_DELETE: 'guildDelete',
|
GUILD_DELETE: 'guildDelete',
|
||||||
GUILD_UPDATE: 'guildUpdate',
|
GUILD_UPDATE: 'guildUpdate',
|
||||||
@@ -217,7 +216,6 @@ exports.Events = {
|
|||||||
GUILD_EMOJI_UPDATE: 'emojiUpdate',
|
GUILD_EMOJI_UPDATE: 'emojiUpdate',
|
||||||
GUILD_BAN_ADD: 'guildBanAdd',
|
GUILD_BAN_ADD: 'guildBanAdd',
|
||||||
GUILD_BAN_REMOVE: 'guildBanRemove',
|
GUILD_BAN_REMOVE: 'guildBanRemove',
|
||||||
CHANNEL_CACHED: 'channelCached',
|
|
||||||
CHANNEL_CREATE: 'channelCreate',
|
CHANNEL_CREATE: 'channelCreate',
|
||||||
CHANNEL_DELETE: 'channelDelete',
|
CHANNEL_DELETE: 'channelDelete',
|
||||||
CHANNEL_UPDATE: 'channelUpdate',
|
CHANNEL_UPDATE: 'channelUpdate',
|
||||||
|
|||||||
Reference in New Issue
Block a user