From 4ff473276d4f2e5b83f61d9fe6a29380ac210601 Mon Sep 17 00:00:00 2001 From: CorwinDev <88144943+CorwinDev@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:12:18 +0100 Subject: [PATCH] Some more bugs fixes --- src/interactions/Command/levels.js | 7 +++++++ src/interactions/ContextMenu/profile.js | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/interactions/Command/levels.js b/src/interactions/Command/levels.js index 4cb0892..4a4a491 100644 --- a/src/interactions/Command/levels.js +++ b/src/interactions/Command/levels.js @@ -1,6 +1,7 @@ const { CommandInteraction, Client } = require('discord.js'); const { SlashCommandBuilder } = require('discord.js'); const Discord = require('discord.js'); +const Schema = require("../../database/models/functions"); module.exports = { data: new SlashCommandBuilder() @@ -63,6 +64,12 @@ module.exports = { */ run: async (client, interaction, args) => { + const guild = await Schema.findOne({ Guild: interaction.guild.id }); + if (!guild.Levels) return client.errNormal({ + error: `The level system is disabled!`, + type: 'ephemeral' + }, interaction); + await interaction.deferReply({ fetchReply: true }); client.loadSubcommands(client, interaction, args); }, diff --git a/src/interactions/ContextMenu/profile.js b/src/interactions/ContextMenu/profile.js index e05bce0..1d491f4 100644 --- a/src/interactions/ContextMenu/profile.js +++ b/src/interactions/ContextMenu/profile.js @@ -18,7 +18,6 @@ module.exports = { */ run: async (client, interaction, args) => { - await interaction.deferReply({ fetchReply: true }); const badgeFlags = { DEVELOPER: client.emotes.badges.developer, EVENT: client.emotes.badges.event, @@ -63,6 +62,7 @@ module.exports = { Schema.findOne({ User: user.id }, async (err, data) => { if (data) { + await interaction.deferReply({ fetchReply: true }); let Badges = await model.findOne({ User: user.id }); let credits = 0; @@ -186,7 +186,7 @@ module.exports = { }, interaction); } else { - return client.errNormal({ error: "No profile found! Open a profile with /profile create", type: 'editreply' }, interaction); + return client.errNormal({ error: "No profile found! Open a profile with /profile create", type: 'ephemeral' }, interaction); } }) },