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