Skip to content

Commit

Permalink
Merge pull request #338 from aydinyal/patch-1
Browse files Browse the repository at this point in the history
Removed duplicate OR operator
  • Loading branch information
victornpb authored Apr 29, 2022
2 parents 41bc8ff + 049f1e4 commit 140569f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deleteDiscordMessages.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ async function deleteMessages(authToken, authorId, guildId, channelId, minId, ma
if (!grandTotal) grandTotal = total;
const discoveredMessages = data.messages.map(convo => convo.find(message => message.hit === true));
const messagesToDelete = discoveredMessages.filter(msg => {
return (msg.type === 0 || || (msg.type >= 6 && msg.type <= 21) || (msg.pinned && includePinned)) && (!regex || msg.content.match(regex));
return (msg.type === 0 || (msg.type >= 6 && msg.type <= 21) || (msg.pinned && includePinned)) && (!regex || msg.content.match(regex));
});
const skippedMessages = discoveredMessages.filter(msg => !messagesToDelete.find(m => m.id === msg.id));

Expand Down

0 comments on commit 140569f

Please sign in to comment.