From 2bc68fb6822da22e9bde7c834dbae837cfdb277d Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Wed, 26 Apr 2023 11:27:19 -0600 Subject: [PATCH] Make the bot not delete extensions that dont have an attached user --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 854a957..4287f25 100644 --- a/index.js +++ b/index.js @@ -267,6 +267,10 @@ dcClient.on('ready', () => { let extensions = result.fetchAllExtensions.extension; extensions.forEach((extension) => { lookupExtension(extension.user.extension, "ext").then((result) => { + if(result.result.fetchVoiceMail.email == null) { + // Extension is not part of the bot, do nothing + return; + }; // Fetch Discord user using ID stored in result.result.fetchVoiceMail.email, and see if they're in the server dcClient.guilds.cache.get(config.discord.guildId).members.fetch(result.result.fetchVoiceMail.email).then((member) => { // They're in the server, do nothing