From 693c876027de9c7379643b7657333e9ec0d51b72 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 25 Apr 2022 16:24:19 +0300 Subject: [PATCH] delete mongo id from imported obj --- src/structure/components/commands/administration/Import.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/structure/components/commands/administration/Import.js b/src/structure/components/commands/administration/Import.js index e6326f2..4a18638 100644 --- a/src/structure/components/commands/administration/Import.js +++ b/src/structure/components/commands/administration/Import.js @@ -64,8 +64,9 @@ class ImportCommand extends SlashCommand { const hooks = await guild.fetchWebhooks(); const hook = hooks.get(webhook); if(hook) await guild.updateWebhook('messages', hook); - } else if(version === '3') { - this.client.storageManager.mongodb.webhooks.updateOne({ feature: 'messages', guild: guild.id }, webhook); + } else if (version === '3') { + delete webhook._id; + await this.client.storageManager.mongodb.webhooks.updateOne({ feature: 'messages', guild: guild.id }, webhook); } }