[CodeFactor] Apply fixes to commit 2e12fe3

This commit is contained in:
codefactor-io 2022-03-03 20:32:00 +00:00 committed by Axel Olausson Holtenäs
parent 91b25452e8
commit 883cd59497
No known key found for this signature in database
GPG key ID: E3AE7E194AE017ED
3 changed files with 12 additions and 11 deletions

View file

@ -6,9 +6,7 @@ module.exports = async (interaction) => {
await credits.find().then(async (data) => {
const topTen = data.sort((a, b) => (a.balance > b.balance ? -1 : 1)).slice(0, 10);
const item = (x, index) => {
return `**Top ${index + 1}** - <@${x.userId}> ${creditNoun(x.balance)}`;
};
const item = (x, index) => `**Top ${index + 1}** - <@${x.userId}> ${creditNoun(x.balance)}`;
const embed = {
title: 'Balance Top',

View file

@ -79,15 +79,20 @@ module.exports = {
async execute(interaction) {
if (interaction.options.getSubcommand() === 'balance') {
await balance(interaction);
} else if (interaction.options.getSubcommand() === 'gift') {
}
else if (interaction.options.getSubcommand() === 'gift') {
await gift(interaction);
} else if (interaction.options.getSubcommand() === 'give') {
}
else if (interaction.options.getSubcommand() === 'give') {
await give(interaction);
} else if (interaction.options.getSubcommand() === 'redeem') {
}
else if (interaction.options.getSubcommand() === 'redeem') {
await redeem(interaction);
} else if (interaction.options.getSubcommand() === 'take') {
}
else if (interaction.options.getSubcommand() === 'take') {
await take(interaction);
} else if (interaction.options.getSubcommand() === 'top') {
}
else if (interaction.options.getSubcommand() === 'top') {
await top(interaction);
}
},

View file

@ -1,3 +1 @@
module.exports = (amount) => {
return `${amount <= 1 ? `${amount} credit` : `${amount} credits`}`;
};
module.exports = (amount) => `${amount <= 1 ? `${amount} credit` : `${amount} credits`}`;