From 049f1e4da7eb930fc7050417b7da0a9f193ec291 Mon Sep 17 00:00:00 2001 From: aydin Date: Wed, 27 Apr 2022 15:32:33 -0400 Subject: [PATCH] Removed duplicate OR operator When I tried to install the script, I noticed the trashcan was not appearing, so I checked the user script and noticed this error. Made a local change and it fixed the extension for me. --- deleteDiscordMessages.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deleteDiscordMessages.user.js b/deleteDiscordMessages.user.js index 9648c497..cca36653 100644 --- a/deleteDiscordMessages.user.js +++ b/deleteDiscordMessages.user.js @@ -143,7 +143,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));