From 7b2c3cb7a42e3d37660ee69db88dac0ddaf2d930 Mon Sep 17 00:00:00 2001 From: ShreshthTiwari <68736752+ShreshthTiwari@users.noreply.github.com> Date: Tue, 11 Jul 2023 21:16:04 +0530 Subject: [PATCH] Update checkStatus.js --- handlers/checkStatus.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/handlers/checkStatus.js b/handlers/checkStatus.js index f2e3f60..073a36c 100644 --- a/handlers/checkStatus.js +++ b/handlers/checkStatus.js @@ -252,14 +252,15 @@ module.exports = async ({ client }) => { .first() ); - if (messages) + if (messages) { for (const MsgEmbed of messages.embeds) { for (const embed of embeds) { if ( MsgEmbed.data.description === embed.data.description ) { - embeds.splice(i, 1); + embeds.splice(i, 1);//This code is wrong i is not defined } + for (const node of nodes) { if ( MsgEmbed.data.description.startsWith( @@ -272,8 +273,11 @@ module.exports = async ({ client }) => { } } } - if (embeds.length > 0) + } + + if (embeds.length > 0) { channel.send({ content: mentions, embeds: embeds }); + } } } }