From 93e0239c8054293eac63338819a10490dbd49ff1 Mon Sep 17 00:00:00 2001 From: ckohen Date: Sat, 31 Jul 2021 17:26:16 -0700 Subject: [PATCH] fix(Util): fix collection import (#6256) --- src/util/Util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/Util.js b/src/util/Util.js index 5528efe36339..44fc59f49829 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -1,6 +1,7 @@ 'use strict'; const { parse } = require('path'); +const { Collection } = require('@discordjs/collection'); const fetch = require('node-fetch'); const { Colors, Endpoints } = require('./Constants'); const Options = require('./Options'); @@ -38,9 +39,9 @@ class Util extends null { const valueOf = elemIsObj && typeof element.valueOf === 'function' ? element.valueOf() : null; // If it's a Collection, make the array of keys - if (element instanceof require('./Collection')) out[newProp] = Array.from(element.keys()); + if (element instanceof Collection) out[newProp] = Array.from(element.keys()); // If the valueOf is a Collection, use its array of keys - else if (valueOf instanceof require('./Collection')) out[newProp] = Array.from(valueOf.keys()); + else if (valueOf instanceof Collection) out[newProp] = Array.from(valueOf.keys()); // If it's an array, flatten each element else if (Array.isArray(element)) out[newProp] = element.map(e => Util.flatten(e)); // If it's an object with a primitive `valueOf`, use that value