Chnaging this idk ehy
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js"
|
import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js"
|
||||||
import { embedColor } from "config/options"
|
import { embedColor } from "config/options"
|
||||||
import settings from "schemas/settingsSchema"
|
|
||||||
import mongoose from "mongoose"
|
import mongoose from "mongoose"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
|
import settings from "schemas/settingsSchema"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "config",
|
name: "config",
|
||||||
@@ -37,7 +37,7 @@ export = {
|
|||||||
|
|
||||||
const setting = interaction.options.getString("setting")
|
const setting = interaction.options.getString("setting")
|
||||||
const value = interaction.options.getString("value")
|
const value = interaction.options.getString("value")
|
||||||
const settingsData = await settings.findOne({ name: setting })
|
const settingsData = await settings.findOne({ filter: { name: setting } })
|
||||||
|
|
||||||
if (!settingsData) {
|
if (!settingsData) {
|
||||||
const newSetting = new settings({
|
const newSetting = new settings({
|
||||||
@@ -55,7 +55,7 @@ export = {
|
|||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
await settings.findOneAndUpdate({ name: setting }, { value: value })
|
await settings.findOneAndUpdate({ filter: { name: setting } }, { value: value })
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
|
|||||||
Reference in New Issue
Block a user