mirror of
https://github.com/danbulant/discord.js
synced 2026-06-20 15:11:32 +00:00
Fix (#1262)
Not ignoring the filterOld boolean when a number is being passed instead of collection or array
This commit is contained in:
parent
4ef0ec491c
commit
6b26d28c06
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue