Skip to content

Commit

Permalink
fix(deleteMessages): Pass reason param into subsequent calls (#1373)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonovanDMC authored May 10, 2022
1 parent c223725 commit 017c18a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ class Client extends EventEmitter {
return Promise.resolve();
}
if(messageIDs.length === 1) {
return this.deleteMessage(channelID, messageIDs[0]);
return this.deleteMessage(channelID, messageIDs[0], reason);
}

const oldestAllowedSnowflake = (Date.now() - 1421280000000) * 4194304;
Expand All @@ -1106,7 +1106,7 @@ class Client extends EventEmitter {
return this.requestHandler.request("POST", Endpoints.CHANNEL_BULK_DELETE(channelID), true, {
messages: messageIDs.splice(0, 100),
reason: reason
}).then(() => this.deleteMessages(channelID, messageIDs));
}).then(() => this.deleteMessages(channelID, messageIDs, reason));
}
return this.requestHandler.request("POST", Endpoints.CHANNEL_BULK_DELETE(channelID), true, {
messages: messageIDs,
Expand Down

0 comments on commit 017c18a

Please sign in to comment.