From d91731f8ebb2f3444ec84b83edeb0a630e90797c Mon Sep 17 00:00:00 2001 From: Taken Date: Thu, 19 Oct 2023 23:50:45 +0200 Subject: [PATCH] Last bug fix hopefully --- commands/config.js | 6 ++++-- scripts/dev-deploy.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/commands/config.js b/commands/config.js index 45debad..44745e3 100644 --- a/commands/config.js +++ b/commands/config.js @@ -37,12 +37,14 @@ module.exports = { if (!settingsData) { - await settings.create({ - _id: mongoose.Types.ObjectId(), + const newSetting = new settings({ + _id: new mongoose.Types.ObjectId(), name: setting, value: value }); + await newSetting.save(); + await interaction.editReply({ embeds: [{ description: "Successfully created `" + setting + "` with value `" + value + "`.", diff --git a/scripts/dev-deploy.js b/scripts/dev-deploy.js index 6ce04a3..4aa81b7 100644 --- a/scripts/dev-deploy.js +++ b/scripts/dev-deploy.js @@ -1,6 +1,6 @@ const { REST, Routes } = require('discord.js'); const env = require('dotenv').config(); -const token = process.env.TOKEN; +const token = process.env.DEVTOKEN; const clientId = process.env.DEVID; const guildId = process.env.GUILDID; @@ -9,7 +9,7 @@ const commands = []; // const commandFiles = fs.readdirSync('./commands-testing').filter(file => file.endsWith('.js')); const commandFiles = [ - './commands/config.js', + "../commands/config.js" ] // Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment