From 34c344e8b39bc19fa51567bc2c4b4dd0ecbaf161 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <72015889+0xtekgrinder@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:42:15 +0200 Subject: [PATCH] fix: duplicate handling wherever of the line position (#41) * fix: duplicate handling wherever of the line position * fix: correct env for DISCORD_TOKEN --- utils/checkRoles.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/checkRoles.js b/utils/checkRoles.js index 635e409..9fac2fe 100644 --- a/utils/checkRoles.js +++ b/utils/checkRoles.js @@ -1172,10 +1172,11 @@ client.on("ready", async () => { for (const embed of embeds) { if ( latestChainIdsMessages.find( - (m) => - m.data.description.replace(/\n/g, "") == - embed.data.description.replace(/\n/g, "") - ) + (m) => { + const description = m.data.description.split("\n"); + const embedDescription = embed.data.description.split("\n"); + return description.every((line) => embedDescription.includes(line)); + }) ) { console.log("chain embed is already the same"); continue;