[CodeFactor] Apply fixes
This commit is contained in:
parent
a4aa42dd24
commit
d7c3843b6a
5 changed files with 21 additions and 13 deletions
|
@ -25,7 +25,7 @@ module.exports = async (interaction) => {
|
|||
footer: { iconURL: process.env.FOOTER_ICON, text: process.env.FOOTER_TEXT },
|
||||
};
|
||||
return await interaction.editReply({ embeds: [embed], ephemeral: true });
|
||||
} else {
|
||||
}
|
||||
const toUser = await credits.findOne({ userId: user.id });
|
||||
toUser.balance -= amount;
|
||||
toUser.save();
|
||||
|
@ -38,5 +38,5 @@ module.exports = async (interaction) => {
|
|||
footer: { iconURL: process.env.FOOTER_ICON, text: process.env.FOOTER_TEXT },
|
||||
};
|
||||
return await interaction.editReply({ embeds: [embed], ephemeral: true });
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -74,15 +74,20 @@ module.exports = {
|
|||
|
||||
if (interaction.options.getSubcommand() === 'balance') {
|
||||
require('./addons/balance.js')(interaction);
|
||||
} else if (interaction.options.getSubcommand() === 'gift') {
|
||||
}
|
||||
else if (interaction.options.getSubcommand() === 'gift') {
|
||||
require('./addons/gift.js')(interaction);
|
||||
} else if (interaction.options.getSubcommand() === 'give') {
|
||||
}
|
||||
else if (interaction.options.getSubcommand() === 'give') {
|
||||
require('./addons/give.js')(interaction);
|
||||
} else if (interaction.options.getSubcommand() === 'redeem') {
|
||||
}
|
||||
else if (interaction.options.getSubcommand() === 'redeem') {
|
||||
require('./addons/redeem.js')(interaction);
|
||||
} else if (interaction.options.getSubcommand() === 'take') {
|
||||
}
|
||||
else if (interaction.options.getSubcommand() === 'take') {
|
||||
require('./addons/take.js')(interaction);
|
||||
} else if (interaction.options.getSubcommand() === 'top') {
|
||||
}
|
||||
else if (interaction.options.getSubcommand() === 'top') {
|
||||
require('./addons/top.js')(interaction);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -4,7 +4,8 @@ module.exports = async () => {
|
|||
try {
|
||||
await mongoose.connect(process.env.MONGODB_URL);
|
||||
console.log('Connected to the database');
|
||||
} catch (e) {
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -7,21 +7,22 @@ module.exports = async function saveUser(data, data2) {
|
|||
_
|
||||
? console.log(
|
||||
`ERROR Occured while saving data (saveUser) \n${'='.repeat(50)}\n${
|
||||
_ + '\n' + '='.repeat(50)
|
||||
`${_ }\n${ '='.repeat(50)}`
|
||||
}`
|
||||
)
|
||||
: 'No Error'
|
||||
);
|
||||
if (data2)
|
||||
if (data2) {
|
||||
data2.save((_) =>
|
||||
_
|
||||
? console.error(
|
||||
`ERROR Occured while saving data (saveUser) \n${'='.repeat(50)}\n${
|
||||
_ + '\n' + '='.repeat(50)
|
||||
`${_ }\n${ '='.repeat(50)}`
|
||||
}`
|
||||
)
|
||||
: 'No Error'
|
||||
);
|
||||
}
|
||||
},
|
||||
data,
|
||||
data2
|
||||
|
|
|
@ -33,7 +33,8 @@ client.on('interactionCreate', async (interaction) => {
|
|||
|
||||
try {
|
||||
await command.execute(interaction);
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error);
|
||||
await interaction.reply({
|
||||
content: 'There was an error while executing this command!',
|
||||
|
|
Loading…
Add table
Reference in a new issue