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

View file

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

View file

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