mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 21:12:06 +00:00
Teensy reorganisation
This commit is contained in:
parent
ac85ffce4b
commit
9cd249342b
1 changed files with 13 additions and 13 deletions
|
|
@ -81,19 +81,6 @@ class Collection extends Map {
|
|||
return arr[Math.floor(Math.random() * arr.length)];
|
||||
}
|
||||
|
||||
/**
|
||||
* If the items in this collection have a delete method (e.g. messages), invoke
|
||||
* the delete method. Returns an array of promises
|
||||
* @returns {Promise[]}
|
||||
*/
|
||||
deleteAll() {
|
||||
const returns = [];
|
||||
for (const item of this.values()) {
|
||||
if (item.delete) returns.push(item.delete());
|
||||
}
|
||||
return returns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of items where `item[prop] === value` of the collection
|
||||
* @param {string} prop The property to test against
|
||||
|
|
@ -262,6 +249,19 @@ class Collection extends Map {
|
|||
for (const [key, val] of this) currentVal = fn(currentVal, val, key, this);
|
||||
return currentVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the items in this collection have a delete method (e.g. messages), invoke
|
||||
* the delete method. Returns an array of promises
|
||||
* @returns {Promise[]}
|
||||
*/
|
||||
deleteAll() {
|
||||
const returns = [];
|
||||
for (const item of this.values()) {
|
||||
if (item.delete) returns.push(item.delete());
|
||||
}
|
||||
return returns;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Collection;
|
||||
|
|
|
|||
Loading…
Reference in a new issue