From b46edb225694603d7ea14ab61895ccd7814a3ef3 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Thu, 16 Dec 2021 19:18:02 -0700 Subject: [PATCH] account for deleted VCs for monit --- commands/utility/monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/utility/monitor.js b/commands/utility/monitor.js index 7a75b8a..d10285f 100644 --- a/commands/utility/monitor.js +++ b/commands/utility/monitor.js @@ -44,7 +44,7 @@ module.exports = { if (Object.keys(tm.voice.members).length) { tv = true; - vch = Object.keys(tm.voice.channels).sort((a, b) => {return tm.voice.channels[a] - tm.voice.channels[b];}).reverse().slice(0, Object.keys(tm.voice.channels).length >= 5 ? 5 : Object.keys(tm.voice.channels).length); + vch = Object.keys(tm.voice.channels).filter(tfc => message.guild.channels.cache.has(tfc)).sort((a, b) => {return tm.voice.channels[a] - tm.voice.channels[b];}).reverse().slice(0, Object.keys(tm.voice.channels).length >= 5 ? 5 : Object.keys(tm.voice.channels).length); vchs = ``; let i; for (i=0; i **${(tm.voice.channels[vch[i]] / 60).toFixed(1)} Hours**\n`;}