Skip to content

Commit

Permalink
Fixed trying to delete other types of system messages
Browse files Browse the repository at this point in the history
  • Loading branch information
victornpb authored Sep 21, 2019
1 parent fa4cb3a commit 3835fe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deleteDiscordMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@
const total = data.total_results;
if (!grandTotal) grandTotal = total;
const myMessages = data.messages.map(convo => convo.find(message => message.hit===true));
const systemMessages = myMessages.filter(msg => msg.type === 3);
const deletableMessages = myMessages.filter(msg => msg.type !== 3);
const systemMessages = myMessages.filter(msg => msg.type !== 0); // https://discordapp.com/developers/docs/resources/channel#message-object-message-types
const deletableMessages = myMessages.filter(msg => msg.type === 0);
const end = () => {
log.success(`Ended at ${new Date().toLocaleString()}! Total time: ${msToHMS(Date.now() - start.getTime())}`);
printDelayStats();
Expand Down

0 comments on commit 3835fe7

Please sign in to comment.