diff --git a/src/commands/credits/addons/take.js b/src/commands/credits/addons/take.js index 76aa865..db0c706 100644 --- a/src/commands/credits/addons/take.js +++ b/src/commands/credits/addons/take.js @@ -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 }); - } + }; diff --git a/src/commands/credits/index.js b/src/commands/credits/index.js index 5ca3c2f..bbb09b7 100644 --- a/src/commands/credits/index.js +++ b/src/commands/credits/index.js @@ -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); } }, diff --git a/src/helpers/database/index.js b/src/helpers/database/index.js index ad9f6cb..4ea36a3 100644 --- a/src/helpers/database/index.js +++ b/src/helpers/database/index.js @@ -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); } }; diff --git a/src/helpers/saveUser.js b/src/helpers/saveUser.js index e29b8b1..68ef757 100644 --- a/src/helpers/saveUser.js +++ b/src/helpers/saveUser.js @@ -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) - data2.save((_) => + 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 diff --git a/src/index.js b/src/index.js index ff6c307..aa416dd 100644 --- a/src/index.js +++ b/src/index.js @@ -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!',