Skip to content

Commit

Permalink
Fix (#1262)
Browse files Browse the repository at this point in the history
Not ignoring the filterOld boolean when a number is being passed instead of collection or array
  • Loading branch information
SpaceEEC authored and iCrawl committed Mar 14, 2017
1 parent 4ef0ec4 commit 6b26d28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/structures/interface/TextBasedChannel.js
Expand Up @@ -395,7 +395,7 @@ class TextBasedChannel {
* @returns {Promise<Collection<Snowflake, Message>>} Deleted messages
*/
bulkDelete(messages, filterOld = false) {
if (!isNaN(messages)) return this.fetchMessages({ limit: messages }).then(msgs => this.bulkDelete(msgs));
if (!isNaN(messages)) return this.fetchMessages({ limit: messages }).then(msgs => this.bulkDelete(msgs, filterOld));
if (messages instanceof Array || messages instanceof Collection) {
const messageIDs = messages instanceof Collection ? messages.keyArray() : messages.map(m => m.id);
return this.client.rest.methods.bulkDeleteMessages(this, messageIDs, filterOld);
Expand Down

0 comments on commit 6b26d28

Please sign in to comment.