Some more bugs fixes

This commit is contained in:
CorwinDev 2022-12-19 15:12:18 +01:00
parent 66a0ce9d71
commit 4ff473276d
2 changed files with 9 additions and 2 deletions

View file

@ -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);
},

View file

@ -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);
}
})
},