mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
fix: remove support for overriding caches that break functionality (#6282)
Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
@@ -21,6 +21,8 @@ const Permissions = require('../util/Permissions');
|
||||
const SystemChannelFlags = require('../util/SystemChannelFlags');
|
||||
const { resolveColor } = require('../util/Util');
|
||||
|
||||
let cacheWarningEmitted = false;
|
||||
|
||||
/**
|
||||
* Manages API methods for Guilds and stores their cache.
|
||||
* @extends {CachedManager}
|
||||
@@ -28,6 +30,13 @@ const { resolveColor } = require('../util/Util');
|
||||
class GuildManager extends CachedManager {
|
||||
constructor(client, iterable) {
|
||||
super(client, Guild, iterable);
|
||||
if (!cacheWarningEmitted && this._cache.constructor.name !== 'Collection') {
|
||||
cacheWarningEmitted = true;
|
||||
process.emitWarning(
|
||||
`Overriding the cache handling for ${this.constructor.name} is unsupported and breaks functionality.`,
|
||||
'UnuspportedCacheOverwriteWarning',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user