mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13: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:
@@ -4,6 +4,8 @@ const CachedManager = require('./CachedManager');
|
||||
const Channel = require('../structures/Channel');
|
||||
const { Events, ThreadChannelTypes } = require('../util/Constants');
|
||||
|
||||
let cacheWarningEmitted = false;
|
||||
|
||||
/**
|
||||
* A manager of channels belonging to a client
|
||||
* @extends {CachedManager}
|
||||
@@ -11,6 +13,13 @@ const { Events, ThreadChannelTypes } = require('../util/Constants');
|
||||
class ChannelManager extends CachedManager {
|
||||
constructor(client, iterable) {
|
||||
super(client, Channel, 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