From 1e6abe587bfc6706bdc2ce299fd7f3f6f557c078 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Thu, 19 Jan 2017 11:10:54 -0600 Subject: [PATCH] no more (#1117) --- src/util/Collection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/Collection.js b/src/util/Collection.js index bca75f5b8..13ab31cc3 100644 --- a/src/util/Collection.js +++ b/src/util/Collection.js @@ -137,7 +137,8 @@ class Collection extends Map { * Searches for a single item where its specified property's value is identical to the given value * (`item[prop] === value`), or the given function returns a truthy value. In the latter case, this is identical to * [Array.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find). - * Do not use this to obtain an item by its ID. Instead, use `collection.get(id)`. See + * All collections used in Discord.js are mapped using their `id` property, and if you want to find by id you + * should use the `get` method. See * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details. * @param {string|Function} propOrFn The property to test against, or the function to test with * @param {*} [value] The expected value - only applicable and required if using a property for the first argument @@ -150,7 +151,6 @@ class Collection extends Map { find(propOrFn, value) { if (typeof propOrFn === 'string') { if (typeof value === 'undefined') throw new Error('Value must be specified.'); - if (propOrFn === 'id') throw new RangeError('Don\'t use .find() with IDs. Instead, use .get(id).'); for (const item of this.values()) { if (item[propOrFn] === value) return item; }